View Full Version : A Problem with glBindTexture
10-05-2003, 08:25 AM
Im just dabbling with textures for a Uni project. I am trying to place them in video memory and refrence them with an integer.
I understand that I need to use glBindTexture for this - however, I get an 'unidentified identifire 'glBindTexture' error when I try and use it.
Am I being totally stupid here?
I think I am using openGL 1.1 or greater, how can I verify this?
EDIT: I just read another thread and i think the reason for my problems are because i'm using Delphi 7. Anyone know how I can resolve the problem?
[This message has been edited by nickcartwright (edited 10-05-2003).]
10-05-2003, 10:18 AM
Make sure you register a valid texture identification integer(the reference) by calling glGenTextures and make sure that the generated ID is different than 0. Here is a sample code:
if(myID == 0) return false;
// Now you can safely bind
10-05-2003, 10:32 AM
Thanks, I think that was a potential problem... but Delphi doesn't like glGenTextures either.
I'v been doing a bit of research and I think Delphi doesn't actually include these routines.
Does anyone know of a good library I can use to replace my current openGL Libs?
delphis 'opengl' unit should have all that.. it seems like you havent even created a opengl render context, becourse those functions should be in that unit as awell.
10-05-2003, 11:48 PM
All I do is stick openGL in the uses clause..
Should I need to do anything else?
10-06-2003, 02:44 AM
The opengl.pas that comes with Delphi isn't that good,as some things are declared wrong and some functions are missing.
But I'm working in a OpenGL2-Port-Team for delphi and we've released an OpenGL1.5-Header here (http://www.delphigl.com/forum/viewtopic.php?t=1863) which should work much better than the one that comes with delphi.
10-06-2003, 07:09 AM
I'v just downloaded it and replaced all my unit uses clases from
and it compiles, But I get an Access Violation error at address 00000000 and my project won't work.
Does dglOpenGL require a different initalisation to the normal Delphi openGL headder?
10-06-2003, 07:30 AM
Yes,sorry that I forget to tell that.You'll have to call the function InitOpenGL before you can use the OpenGL-functions in that unit.
The rest of it is like Mike Lischke's OpenGL12.pas.So to init your program and get a valid rendercontext you'll have to do something like this :
DC : HDC;
RC : HGLRC;
DC := GetDC(Handle);
RC := CreateRenderingContext(DC, [opDoubleBuffered], 32, 24, 0, 0, 0, 0);
10-06-2003, 07:55 AM
That works like a dream!
Thanks everyone for their help on this Thread. Much appreciated!
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.