Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Dybbuk

OpenGL Delphi and openGL problem

This topic is 5621 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all, For an assignment in my Delphi classes i have to make a Program. I decided to make a little openGL game. But i ran into some trouble. I never combined openGL and delphi before so i used jan horn''s framework and texture loading routine to start with. (http://www.sulaco.co.za/) I bind some textures and draw some stuff, so far so good But now for that problem: When i try to load any textures in an other unit than my main unit the texture won''t load, and my object remain white/gray. I declare all variables in the other unit but it wil still not work. I tough, i''ll try to fix that problem later and coded on. Next i wanted to make a display list and again it didn''t work. When i made an app with only one unit that code worked fine, but when i copy ased it in my project nothing was drawn when i called the list. I guess these problems are related but have no clue what is causing it. Is it a Delphi or openGL related problem? I haven''t got much experience with delphi, but this even stumped my teachers.... If somebody want to review my code, reply and i will email it to you.

Share this post


Link to post
Share on other sites
Advertisement
I use Delphi so will look at your code if you like - are you sure in your ''USES'' statement for the other unit you''re including ALL the relevant files? Are there any differences between the Uses statement in the main form ?

If you want to program Opengl in Delphi I would personally recommend the DOT library from Tom Nuydens (totally free!)

(http://www.delphi3d.net)

Share this post


Link to post
Share on other sites
I use the exact same include statements. But it would be nice if you would take a look at the code. I''ll mail it to you asap

Share this post


Link to post
Share on other sites
when you are loading the textures, are all of your buffers set sufficiently large to allow for the number you are generating?

GLuint textures[n];

AUX_RGBImageRec *TextureImage[n];

glGenTextures(n, &texture[0]);

all these lines need the same number of textures "n". I had exactly the same problem, which took me a while to figure out.

Share this post


Link to post
Share on other sites
Hi

If you download this from the same site it will make things a lot easier.

Just declare a TGLuint:

mytexture: TGLuint;

"- call the load function. LoadTexture(''images/mytexture.jpg'', myTexture, FALSE);
and then you can bind the texture."

This should work from any unit, good luck


______________________________

DGDev - The Delphi Games Development Community

Share this post


Link to post
Share on other sites
Damn i feel stupid...

I generated diplay lists in de form.create, thus before my rendering context was created. I haven''t had tinme to fix it, but i am sure this is the problem...

Doesn''t it always that the simplest problems are the herdest to find..

Thx for all you replies guys!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!