flat assembler
Message board for the users of flat assembler.

Index > Windows > OpenGL and negative float values

Author
Thread Post new topic Reply to topic
Make76



Joined: 13 Aug 2007
Posts: 2
Location: Finland
Make76 21 Aug 2007, 07:06
How could i use negative float values in OpenGL functions?

Next line works fine:
invoke glTranslatef,0.0f,0.0f,-5.0f

But if i use variable then negative value does not work:

z GLfloat -5.0f

invoke glTranslatef,0.0f,0.0f,z

Maybe i should use another variable type than GLfloat, but what?
Post 21 Aug 2007, 07:06
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 21 Aug 2007, 07:56
you would need to define it in your data section:
Code:
section '.data' data readable writeable
z dd -5.0    

then do this
Code:
invoke glTranslatef, 0.0, 0.0, [z]    
Post 21 Aug 2007, 07:56
View user's profile Send private message Reply with quote
Make76



Joined: 13 Aug 2007
Posts: 2
Location: Finland
Make76 21 Aug 2007, 08:57
Thanks madmatt it worked . Very Happy
Post 21 Aug 2007, 08:57
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.