PDA

View Full Version : MFC and OpenGLSL



L.BB
03-06-2006, 08:04 AM
I am trying to create a shader within an MFC application.I am using Microsoft Visual C++ and WinXP. I have included the glew.h file and everything seems to work fine until I try to execute my application and it gives me a Microsoft Error. When I go into the debug it says that CXX0017:Error: Symbol "this" was not found. I found out that as soon as I try

GLhandleARB v = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);

Microsoft gives me an error. Strange thing is though that I first tried the whole code in a "normal" OpenGL program (without MFC) and it was working perfectly. And now I am trying to integrate that program into my MFC application where all other OpenGL seems to work fine. But as soon as I create a shader object or refer to it, Microsoft gives me an error.

Any ideas????Is GLSL not supported by MFC???

knackered
03-06-2006, 12:52 PM
I'm sorry, but you're an embarrassment to the Irish nation.

Go to the beginners forum, this is nothing to do with GLSL, it's to do with you not understanding the OpenGL extension mechanism on win32.

def
03-07-2006, 05:06 AM
@knackered: very helpful!

@L.B: Did you check to see if glewInit() failed?
You probably need to correct your project setup to make MFC code work with GLEW. It's not clear if you have a compile, link or runtime error. If it's a linking error make sure you are linking with the glew library.

knackered
03-07-2006, 11:56 AM
...or stay a while and discuss beginners OpenGL compilation issues in the "OpenGL Shading Language" forum.

L.BB
03-08-2006, 04:31 AM
Hi! Thank you, yes it was a problem with GlewInit().

And to knackered...I was not aware that it was a problem with my setup and that is why I thought that there was maybe something going on with my OpenGLSL. Yes I am a beginner and I did not mean to "upset" anyone by writing to the slightly inappropriate forum...maybe get some sleep?:-)

knackered
03-08-2006, 08:15 AM
You goddam fool ;)