Closed Zortexxx619 closed 1 year ago
glClearTexImage is available only if the GL version is 4.4 or greater.
It is strongly recommended to check for the expected functionality.
as I mentioned, my GPU supports GL 4.4. glGetString(GL_VERSION)
in the code even returns 4.4.
After having looked at it and researched some more, it seems the issue actually has to do with Eclipse CDT not being able to parse the function since it's defined as a macro in glew.h, and isn't actually defined until runtime (or something along those lines.) What's happening thereafter is either the function isn't actually getting defined, or I'm using it wrong without the compiler stopping me.
Not sure if this makes it more of an Eclipse issue than a GLEW one, or if there's a way to get Eclipse to parse the functions properly.
Okay, I figured out the issue, it was a lot simpler than I thought. I was calling glewInit()
before creating a window/context with glut, which was casing it to fail to initialize. Changing the order fixes it.
(sorry if this isn't the right place or the right format to post something like this, I'm still new to github)
I'm trying to start work on a small project in order to learn working with OpenGL, but I'm running into a major roadblock.
I'm using Eclipse CDT, with MinGW-W64 as my compiler. My GPU supports OpenGL 4.4. I've linked and included all the relevant GLEW & GLUT files as far as I can tell, but something's evidently wrong with it and I cannot tell what: functions and constants that are part of extensions are seemingly undetected by my IDE (other than as definitions). There are no compilation errors, but the program crashes when it gets to the glClearTexImage function; no error message (even the debugger found nothing), the program's window appears, freezes, then the program terminates.
The following is my code. It is modified from a triangle-drawing example whose source I can no longer find (comments are mostly from that):
I've looked all around but I've not been able to find a solution to this issue. The only thing I can think of is that using the pre-built binaries for GLEW instead of building it myself is causing an issue, but that's only a guess. Any help at all would be appreciated.