Creating a Window // OpenGL Tutorial #1

preview_player
Показать описание
The following are affiliate links - if you purchase something the price is the same for you
and I get a commission.

In this video I will show you how to create a window to be used with OpenGL using FreeGLUT (I'm referring to 'FreeGLUT' as 'GLUT' in the video).

If you want to get the same version that was used in the video checkout the tag TUT_01_CREATE_WINDOW.

🔥 I'm using the following books as background information for my tutorials and I highly recommend them for learning more about OpenGL and Vulkan.
These are affiliate links so if you use them to buy the books the price is the same for you and I will get a small commision (thank-you!).

Time codes:
0:00 - Intro
2:09 - glutInit
3:20 - glutInitDisplayMode
4:44 - Init window params
5:07 - Create a Window
5:32 - glClearColor
7:03 - glutDisplayMode
7:35 - glutMainLoop
8:07 - glClear
8:21 - glutSwapBuffers
10:22 - glutPostRedisplay
10:55 - How to build the code
13:39 - Conclusion

Feel free to comment below.

Twitter: @ogldev

Enjoy,

Etay Meiri

#opengl #ogldev #opengtutorials
Рекомендации по теме
Комментарии
Автор

Thanks for the tutorial :)
Flickering issue: My window was flickering black and white, but it was fixed after having Sleep(5); inside RenderSceneCB().
After having that Sleep(), I was able to achieve the visual effect as what's seen on the video. Color gradually changing, not flickering.
Leaving this comment here for anybody is having the same issue.

SJ-sqwf
Автор

There is no better material to learn OpenGL from. Was my choice after going through diverse sources. And it's really cool to see Mr. Emeiri himself on the new videos! I am forever thankful for such clear, motivating and great explanation material. 🙏🏻

capsbr
Автор

This is wonderful! And after toiling for the better part of 4 hours I have managed to run the window in VS Code! I am very proud of myself 😂

hbushnell
Автор

wow, this looks like quite the playlist
many thanks for sharing your knowledge and for sharing written versions of your tutorials on your website

samdavepollard
Автор

Thanks for making these videos. They are a perfect accompaniment to your written articles.

ImmortalityYT
Автор

Very happy to see you keeping up the graphics initiative. Very well explained as well! Freeglut rules!

eyalbarlev
Автор

Thanks for this. Looking very much forward to following along with the series!

conorstevenson
Автор

Thank you for these very informative and enjoyable tutorials.
The glutInitWindow- prefix functions can be called *before* glutInit() to set default values that can then be overridden by the command line options.

ChrisDEV-jztf
Автор

Thanks for the tutorial. I decided to bite the challenge and do it from scratch with win32 and wgl .. it was a painful process, but it's working :).

BMarques
Автор

Many thanks, your resource is so great!!

huybuiquoc
Автор

OGLDEV, I love your videos. They have been so helpful in my programming journey. Have you ever used SDL for windowing?

DeusVultGames
Автор

@3:10 It works in my computer( Win10, MSYS2, freeglut3.2.2):

for (int i = 0; i < argc; i++) printf("before glutInit, argv[%i]=%s\n", i, argv[i]);
glutInit(&argc, argv);
for (int i = 0; i < argc; i++) printf("after glutInit, argv[%i]=%s\n", i, argv[i]);


FreeGLUT parameters were removed from "argv" array, and value of "argc" was reduced as well with a call like this "./app par1 par2 -sync -mypar=1 -gldebug lastparam".

voytechj
Автор

my brain is cooking as i watch the tutorial, it is overwhelming not difficult, this was simple but there was a hint of ambiguity after i watched it, i guess with time i will understand this stuff

hodayfah
Автор

01:11 - Appreciate your hard work however

yourcommander
Автор

On the RenderSceneCB function, why does the GLclampf needs to be static? I was missing the static keyword and the glutPostRedisplay function wasn't working properly

Angelo-vbdg
Автор

Sorry, I want to ask this small question.
I want to learn about OpenGL but sadly I only have knowledge about Java. Can I still follow this tutorial, will the functionality such as method, etc same logic of OpenGL is the same like in C++?

Thank you. 🤗

tienthanh
Автор

So how do you build the program to an actual app?

shrippie-
Автор

Hi. Do I need to know a strong programming experience to learn opengl?

yogeshnimkar
Автор

Can you open two independent windows with glut?

at
Автор

@OGLDEV

printf("Have %d arguments\n", argc);
for (int i = 0; i < argc; ++i) {
printf("%s\n", argv[i]);
}

mmaurier