Creating a Window // OpenGL Tutorial #1

  Рет қаралды 33,480

OGLDEV

OGLDEV

Күн бұрын

Пікірлер: 50
@capsbr2100
@capsbr2100 3 жыл бұрын
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. 🙏🏻
@OGLDEV
@OGLDEV 3 жыл бұрын
Wow! Thank you! I'm really glad you found it useful.
@samdavepollard
@samdavepollard 10 ай бұрын
wow, this looks like quite the playlist many thanks for sharing your knowledge and for sharing written versions of your tutorials on your website
@OGLDEV
@OGLDEV 10 ай бұрын
You are welcome!
@eyalbarlev
@eyalbarlev 3 жыл бұрын
Very happy to see you keeping up the graphics initiative. Very well explained as well! Freeglut rules!
@OGLDEV
@OGLDEV 3 жыл бұрын
Thanks buddy! Are you ready for tomorrow? I can make a tutorial about that ;-)
@ImmortalityYT
@ImmortalityYT 3 жыл бұрын
Thanks for making these videos. They are a perfect accompaniment to your written articles.
@OGLDEV
@OGLDEV 3 жыл бұрын
Thanks :-)
@conorstevenson6856
@conorstevenson6856 3 жыл бұрын
Thanks for this. Looking very much forward to following along with the series!
@OGLDEV
@OGLDEV 3 жыл бұрын
Glad you liked it :-)
@ChrisDEV-jz2tf
@ChrisDEV-jz2tf 8 ай бұрын
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.
@OGLDEV
@OGLDEV 8 ай бұрын
Thanks for the info!
@huybuiquoc3083
@huybuiquoc3083 3 жыл бұрын
Many thanks, your resource is so great!!
@OGLDEV
@OGLDEV 3 жыл бұрын
You are welcome!
@BMarques803
@BMarques803 3 жыл бұрын
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 :).
@OGLDEV
@OGLDEV 3 жыл бұрын
Great to hear that you lived to tell the tale ;-) I had the honor of participating in a few Khronos meetings on EGL. These low level windowing APIs can be a pain...
@BMarques803
@BMarques803 3 жыл бұрын
@@OGLDEV Yeah, luckily I knew where to look for, as the Hands-On C++ Game Animation Programming does this exactly :). I did it a bit differently, but it was inspired by it.
@OGLDEV
@OGLDEV 3 жыл бұрын
Took a look at the table of contents. Looks very impressive.
@DeusVultGames
@DeusVultGames Жыл бұрын
OGLDEV, I love your videos. They have been so helpful in my programming journey. Have you ever used SDL for windowing?
@OGLDEV
@OGLDEV Жыл бұрын
Thanks! I currently playing a bit with SDL on the Mac but I'm not very experienced with it.
@yourcommander3412
@yourcommander3412 2 жыл бұрын
01:11 - Appreciate your hard work however
@OGLDEV
@OGLDEV 2 жыл бұрын
Thanks!
@voytechj
@voytechj 2 жыл бұрын
@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 ", i, argv[i]); glutInit(&argc, argv); for (int i = 0; i < argc; i++) printf("after glutInit, argv[%i]=%s ", 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".
@OGLDEV
@OGLDEV 2 жыл бұрын
Thanks for the feedback! Perhaps there is a bug with the Linux version of FreeGLUT.
@voytechj
@voytechj 2 жыл бұрын
@@OGLDEV Could be. I ran the program in Ubuntu20.04 with freeglut-dev version 2.8.1 as well and it worked. For example "./app -geometry 1024x512 --otherparam" set the resolution and removed "-geometry 1024x512" from the argument lists. I looked in the freeglut source code and it all happens in "fg_init.c" file in a fghParseCommandLineArguments function. It looks like this functionality is turn off only for WindowsCE.
@hodayfa000h
@hodayfa000h 2 ай бұрын
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
@OGLDEV
@OGLDEV 2 ай бұрын
Please let me know if there are specific points that require more coverage. tnx.
@Angelo-vb6dg
@Angelo-vb6dg 2 жыл бұрын
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
@OGLDEV
@OGLDEV 2 жыл бұрын
The only static keyword in this file is on the RenderSceneCB function. The GLclampf variables are regular.
@tienthanh2992
@tienthanh2992 3 жыл бұрын
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. 🤗
@OGLDEV
@OGLDEV 3 жыл бұрын
AFAIK, JOGL (the Java binding API for OpenGL) provides the same functionality as the C API. Therefore, you should be able to use the tutorials but it will require you to replace the basic classes such as math, etc with your own implementation (not a bad experience). Also, simply map each C API to its Java counterpart. Since both C++ and Java are OOP you can follow up on my class design if you wish or branch out on your own. btw, ThinMatrix provides good tutorials for OpenGL on Java. They are a bit older but probably still reusable and can help you get started.
@shrippie-4214
@shrippie-4214 3 жыл бұрын
So how do you build the program to an actual app?
@OGLDEV
@OGLDEV 3 жыл бұрын
All my tutorials have their own folders and each folder contains a very simple build.sh script that must be executed from within that folder in order to build the executable. I'm not using any build system because it's a bit of an overkill for such small sample programs. You can simply take a look at the build script and get the build and link flags and copy them into whatever Makefile or something that you are using. For Windows I have a Visual Studio solution under ogldev/Windows.
@shrippie-4214
@shrippie-4214 3 жыл бұрын
@@OGLDEV holy s*it linux is frustrating sometimes
@OGLDEV
@OGLDEV 3 жыл бұрын
@@shrippie-4214 In what sense?
@yogeshnimkar3784
@yogeshnimkar3784 3 жыл бұрын
Hi. Do I need to know a strong programming experience to learn opengl?
@OGLDEV
@OGLDEV 3 жыл бұрын
To get started you just need a basic knowledge in C/C++. There are other language bindings but the OpenGL spec is written in C. You can build up your programming experience by following up on both programming and 3D/game development tutorials in parallel as you work your way towards a project such as a simple game or game engine.
@at0977
@at0977 3 жыл бұрын
Can you open two independent windows with glut?
@OGLDEV
@OGLDEV 3 жыл бұрын
Yes. You can create two windows using glutCreateWindow() and then use glutSetWindow() to set a window current. This means that any followup glut calls (like setting the render callback) will be applied to the current window only. So you set one window current, initialize everything it needs and then switch to the other one and do the same.
@OGLDEV
@OGLDEV 3 жыл бұрын
I created a video about that: kzbin.info/www/bejne/baWrdXmFmdCgZ6c
@quadriproduction
@quadriproduction 3 жыл бұрын
also better use cmake for build
@OGLDEV
@OGLDEV 3 жыл бұрын
I really dislike cmake because I find it overly complicated. For the foreseeable future my tutorials will not include more than a handful of files so cmake will be an overkill anyway. I simply maintain my build scripts in parallel with the Visual Studio solution on Windows and it doesn't take much of my time. I also don't want to impose a specific build system on people. They can simply take a look at the compiler flags and source list in the build script and adapt it to their preferable system. Didn't you just write a comment on GLFW? seems that youtube deleted that. A recurring problem... I used FreeGLUT because I wanted to use the sources from my old website as a baseline and it was easier for me. The bottom line is that GLFW and FreeGLUT just take care of the boilerplate for windowing, input ctrl, etc and you tend to forget them later on. I focus on teaching 3D rendering so the windowing library is not that critical. I actually do have a tutorial on GLFW on the website (ogldev.org/www/tutorial44/tutorial44.html) where I show how to keep GLFW and FreeGLUT side by side and I plan to do a video on that in the near future. Thanks for the feedback!
@user-zi8wd3ov8m
@user-zi8wd3ov8m 8 ай бұрын
ישראלי?
@OGLDEV
@OGLDEV 8 ай бұрын
כן
@user-zi8wd3ov8m
@user-zi8wd3ov8m 8 ай бұрын
@@OGLDEV איך מזהים מהמבטא אה חחח , כל הכבוד לך על העבודה ומה שאתה עושה באמת, לא חשבתי שאמצא מישהו דובר עברית מנוסה בכל הזה, אני אשמח ויעריך מאוד אם אוכל להתייעץ איתך מדי פעם על התחום
@OGLDEV
@OGLDEV 8 ай бұрын
סבבה בכיף
@mmaurier2007
@mmaurier2007 4 ай бұрын
@OGLDEV printf("Have %d arguments ",argc); for (int i = 0; i < argc; ++i) { printf("%s ",argv[i]); }
@OGLDEV
@OGLDEV 4 ай бұрын
Sorry, not sure I understand the context.
Render Your First Dot  // OpenGL Tutorial #2
19:48
OGLDEV
Рет қаралды 16 М.
Setting up OpenGL and Creating a Window in C++
22:03
The Cherno
Рет қаралды 835 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
The OpenGL Software Ecosystem
13:51
OGLDEV
Рет қаралды 10 М.
I Made a Drawing Software From Scratch (C++ & OpenGL)
11:05
iamwassim
Рет қаралды 41 М.
Animated fireplace on DOS
36:27
FreeDOS
Рет қаралды 26 М.
The Value of Source Code
17:46
Philomatics
Рет қаралды 214 М.
OpenGL Tutorial 1 - Window
7:50
Victor Gordan
Рет қаралды 115 М.
Perspective Projection - Part 1 // OpenGL Tutorial #11
24:13
Should you learn Vulkan(C++)? Can beginners  learn it?
8:49
codergopher
Рет қаралды 66 М.
Learning VULKAN by Rendering a GALAXY
6:10
frozein
Рет қаралды 37 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН