Creating a Window // OpenGL Tutorial #1

Поділитися
Вставка
  • Опубліковано 30 січ 2025

КОМЕНТАРІ • 50

  • @capsbr2100
    @capsbr2100 3 роки тому +10

    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 роки тому +4

      Wow! Thank you! I'm really glad you found it useful.

  • @samdavepollard
    @samdavepollard Рік тому

    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  Рік тому +1

      You are welcome!

  • @eyalbarlev
    @eyalbarlev 3 роки тому +1

    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 роки тому +1

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

    • @OGLDEV
      @OGLDEV  3 роки тому

      Thanks :-)

  • @conorstevenson6856
    @conorstevenson6856 3 роки тому +1

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

    • @OGLDEV
      @OGLDEV  3 роки тому

      Glad you liked it :-)

  • @ChrisDEV-jz2tf
    @ChrisDEV-jz2tf 10 місяців тому

    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  10 місяців тому

      Thanks for the info!

  • @BMarques803
    @BMarques803 3 роки тому +1

    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.

  • @huybuiquoc3083
    @huybuiquoc3083 3 роки тому +1

    Many thanks, your resource is so great!!

    • @OGLDEV
      @OGLDEV  3 роки тому

      You are welcome!

  • @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.

  • @hodayfa000h
    @hodayfa000h 3 місяці тому

    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  3 місяці тому

      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.

  • @shrippie-4214
    @shrippie-4214 3 роки тому +1

    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 роки тому +1

      @@OGLDEV holy s*it linux is frustrating
      sometimes

    • @OGLDEV
      @OGLDEV  3 роки тому +1

      @@shrippie-4214 In what sense?

  • @voytechj
    @voytechj 2 роки тому +1

    @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 роки тому +1

      @@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.

  • @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: ua-cam.com/video/7tHDFOdkm1E/v-deo.html

  • @yourcommander3412
    @yourcommander3412 2 роки тому

    01:11 - Appreciate your hard work however

  • @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 роки тому +1

      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.

  • @quadriproduction
    @quadriproduction 3 роки тому

    also better use cmake for build

    • @OGLDEV
      @OGLDEV  3 роки тому +1

      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 10 місяців тому

    ישראלי?

    • @OGLDEV
      @OGLDEV  10 місяців тому

      כן

    • @user-zi8wd3ov8m
      @user-zi8wd3ov8m 10 місяців тому

      @@OGLDEV איך מזהים מהמבטא אה חחח , כל הכבוד לך על העבודה ומה שאתה עושה באמת, לא חשבתי שאמצא מישהו דובר עברית מנוסה בכל הזה, אני אשמח ויעריך מאוד אם אוכל להתייעץ איתך מדי פעם על התחום

    • @OGLDEV
      @OGLDEV  10 місяців тому +1

      סבבה בכיף

  • @mmaurier2007
    @mmaurier2007 5 місяців тому

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

    • @OGLDEV
      @OGLDEV  5 місяців тому

      Sorry, not sure I understand the context.