OpenGL Texturing

Sorry for asking for help, but I'm upset.

I don't know why, but I could never get textures to work in OpenGL. I would really appreciate the minimal example if it uses only /gl.h/glu.h and the standard C ++ libraries. Any other insights would be appreciated.

Sorry to ask you to write an entire program for me, but I really could use it, since EVERY internet example that I saw uses oversaturation. I cannot compile it for some reason, and it is very annoying.

Thanks.

+4
source share
3 answers

NEEDS some library or interface for creating OpenGL context (and windows for displaying it).

GLUT is deprecated but still popular; Good options are currently GLFW or SDL. I recommend GLFW.

(By the way, why did you even need to compile GLUT? Doesn't it have precompiled binaries for Windows?)

Or you can use system functions; in your case - WinAPI. However, this is a very tedious process; unlike portable solutions, which create a window in only one or two lines of code and provide easy input processing.

Once you close and run the GL window , you can learn texturing (or something else) from any tutorial . OpenGL calls will be the same, no matter how the window was created.

+4
source

Here is a good tutorial:

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=06

This code does not use kink.

+1
source

To create a window, you need a window manager, for which you will create a context where you can display your image. You cannot do this with standard C ++.

It is not clear which OS you are targeting, but there are cross-platform environments such as GLUT, SDL, etc. You can also do this with xlib if you are on Linux.

+1
source

All Articles