PDA

View Full Version : glCreateProgramObjectARB crashes delphi app



th0r1000
07-22-2006, 02:22 PM
Hi

Ive been trying to get the basics of shaders under the knee. Ive written a very basic shader
in GLSL but now I am trying to run the program but on init when I call glCreateProgramObjectARB it crashes with an access violation. Im using Delphi 7 with the gl.pas and glext.pas from delphi3d. I also read the lighthouse3d tutorials.
Is it maybe connected to the setting up of my pixel format? If someone could help me it would be much appreciated cause this is getting frustrating.

sqrt[-1]
07-22-2006, 06:40 PM
Did you initialize your extension pointers?
Are you passing correct strings to OpenGL?

Jedimaster
07-22-2006, 08:54 PM
must

glewInit()

Zengar
07-23-2006, 03:56 AM
Looks to me as if you don't initialize the pointer to the function correctly. If I am not mistaken, there are functions like Load_***_extension. Make shure that you create a valid context and load the extension properly.

th0r1000
07-25-2006, 02:20 PM
Thanks guys, I did indeed forget to load some of the extensions. Do any of you know what extension I should load to be able to call glActiveTexture(GL_TEXTURE0) since this is also giving me an access violation. I got the simpletexture shader from lighthouse3d working but the multitexturing one doesnt want to work.
I either get one of the textures or the other but not both combined. I think I have to do something like:
glActiveTexture(GL_TEXTURE0);{this causes violat}
glBindTexture(GL_TEXTURE_2D,tex);glActiveTexture(G L_TEXTURE1);
glBindTexture(GL_TEXTURE_2D,l3d);
but glActiveTexture cases the violation.
Does anyone know how to fix this?