Jump to content
  • Advertisement
Sign in to follow this  
Scrooby

Problems using glMultMatrixf in Delphi

This topic is 4841 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

Because the Tut about Quaternions didn't have a source for Delphi users, like myself, I tried to write a conversion. But I've got some problems with the glMultMatrixf function Vic Uses in his funtion to the new prespective on the world. When I use the function there is no drawing at all and the screen stays black. glMultMatrixf wants PGLfloat as I understood this shall be a pointer that points to the first element of an Array, because C++ uses pointers to represent arrays. But Delphi does not, so I created a pointer myself that points to my array and give it to the function. No Error is created but there is, as I said nothing on the screen when I use this function, although I tested it using a Identity Matrix I created, which once given to glMultMatrixf should not change anything at all. The Code is much the same of Vic's exept that I changed it to Delphi and use my function to load Textures which is working properly since i dont know. So this is not the poblem I think. Please anyone tell me what I am doing wrong, because I loved to use Quaternions in my Projects. Sincerly Scrooby

Share this post


Link to post
Share on other sites
Advertisement
a code snippet might be handy... the first problem which springs to mind is column vs row major issues, do you know which format Delphi uses for arrays?

Share this post


Link to post
Share on other sites
procedure glCamera.setPrespective();
var Matrix : array[0..15] of GLfloat;
pMatrix :pointer;
begin
[...]
pMatrix := @Matrix;
// Opengl set new prespective

// Problem somewhere here:
glMultMatrixf(pMatrix);
[...]
end;

And the problem rows vs. columns came to my mind aswell, but for the identity vector it's not important ...

1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1

same if you read it in rows or in columns.

The format Delphi uses to store arrays I'm gonna check now..

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!