[Episode 5] [Code] Setup SDL2 and OpenGL and first OpenGL function (glGetString) - Modern OpenGL

preview_player
Показать описание

►Lesson Description: In this lesson I show you step by step how to create an SDL2 window, setup an opengl context, and ultimately call your first OpenGL function. This is a longer lesson, but should be useful in helping you put together all the information you need to get started with OpenGL programming.

►Please like and subscribe to help the channel!
Рекомендации по теме
Комментарии
Автор

I love your videos. After learning sdl, i was bored so I followed your tutorials to learn OpenGL. So far, I have been learning a lot

JumpercraftYT
Автор

The cool thing about this video is that you made everything from scratch and separated each part of the process. It became easier to understand how OpenGL really works.

MarcosCpp
Автор

Exactly what I needed! so professional and to the point. Thanks!

hannahm
Автор

Amazing series, your a life changer! So glad I found it while looking to start actually learning C++ and OpenGL. Got it working on Windows with MSYS2

BrandonWingerAir
Автор

This is Wonderful! I'm enjoying following along in linux using the command line to compile and just a simple text editor to code. Looking forward to the rest of the series!

larfingshnew
Автор

Incredible that this course is free! Thanks a lot Mike

thoric
Автор

I just started a Bachelor in Automation Engineering where I had an introduction to strict C.

I managed to get this OpenGL and SDL2 because of this lesson and, in my opinion, this channel should be in the 500k views.

Good explanations, lots of fiddling around (which is actually awesome because you get to see some quality troubleshooting).

Love it so far!

guillaumebourgeois
Автор

Mike is an AMAZING teacher!! We need him in Russia

traudlgoring
Автор

Thanks Mike for the lesson, nicely done!

qblfzxq
Автор

There is also the SDL_opengl.h header file that I have seen in other tutorials. I saw it includes the same OpenGL API functions/constants found in GLAD, such as glGetString, GL_VENDOR, etc, although I had some linker issues when I tried to compile that I didn't bother with. Do you happen to know what is SDL_opengl.h used for? From what I see it can be used in place of GLAD/other OpenGL extensions but I don't see it ever used.

thomasnguyen
Автор

Hi Michael, thanks for the videos in this series! Why not having a Github repository?

michaelkohlhaas
Автор

I just recently started working on getting a GLFW project up and running but for some reason whenever I build and run, the window pops up but Linux wants to force quit the process.

Looking forward to your future videos so I can keep working in OpenGL

robertstrickland
Автор

Thanks for that awesome video.
Can someone tell me pls, how can I set up my terminal to be so simple and convinient like your one? In which direction I should look?

rouchy_
Автор

If I wanted the openGL window to be a panel or frame within a wxWidgets app, how would these steps you do here be incorporated in the wxWidgets app? I mean, would this code be in some other function or must it be where I setup the frame or panel in my application? Im a little lost as to how to setup openGL in wxWidgets. Thank you.

paulklasmann
Автор

Hi. I have a question. Why did you choose SDL2 for OpenGL and not GLFW for example?

demrukd
Автор

Only your tutorials worked out for me, they are one of their kind.

This is not a problem, but: When you executed your application after all changes( addition of glGetString(GL_RENDERER) ), it showed in "out": nvidia discrete gpu, but for me it shows intel integrated with "mesa"

I tried to grep glxinfo and it showed my nvidia discrete card

Is there a way to set a default renderer to GPU in my current source code?
(sorry, I tried to google it, but I couldn't find any suitable answers)

heyheyheyhoev
Автор

and seem glfwPollEvents is better than Pool Event of SDL because the CPU still in low percent when app go to glfwPollEvents

binhnguyenthanh
Автор

I want to create a 3D games, should I need combine SDL2 and OpenGL

binhnguyenthanh
Автор

Everything was going well until I got to the part where you ran the program and your window popped up. When I run the program there are no errors and the main event loop is running (tested it with cout and it just fills my terminal) but no window seems to show up? Any ideas?

FrsTyProductions
Автор

I am having some issues with the default GPU to render this. i am not sure how to change it.
context:
- I am using WSL2 Ubuntu 22.04
- I have AMD Radeon 780m Graphics integrated gpu
- and NVIDIA GeForce rtx 4060 laptop gpu

when i do lspci it shows both of them as "Microsoft Corporation Device 008e"

and for the line > std::cout << "Rendered : " << glGetString(GL_RENDERER) << std::endl;
it prints out > Rendered : D3D12 (AMD Radeon 780M Graphics)

how do i change it to nvidia, i have all the drivers installed. and i am lost. please help.

marshedmello