flat assembler
Message board for the users of flat assembler.

Index > Main > about passing doubles to glFrustum, sprintf, ect..

Author
Thread Post new topic Reply to topic
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 14 Feb 2010, 20:22
I am working on an opengl example, but I can't seem to get glFrustum to work. It accepts 6 doubles, but I'm not sure where to put these. sprintf has similar issues. This is the only thing i've tried that works:

Code:
         sub   esp,8*6
         movupd   xm0,[@f]
         movupd   [esp],xm0
         movupd   xm0,[@f+8*2]
         movupd   [esp+8*2],xm0
         movupd   xm0,[@f+8*4]
         movupd   [esp+8*4],xm0
         invoke glFrustum
         ret

  @@: GLdouble -0.5,0.5,-0.5,0.5,1.0,10.0        

Is there a better way?? Also, if they are floating point arguments, shouldn't they be passed in the fpu?
Post 14 Feb 2010, 20:22
View user's profile Send private message Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
windwakr 14 Feb 2010, 20:36
invoking with "double" works.

Code:
invoke glFrustum,double 1.0,double 555.456,double 879.125.....etc.
    

_________________
----> * <---- My star, won HERE
Post 14 Feb 2010, 20:36
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 15 Feb 2010, 01:22
that does not compile for me: 'double' is not a defined symbol
Post 15 Feb 2010, 01:22
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20416
Location: In your JS exploiting you and your system
revolution 15 Feb 2010, 01:32
You need to include an 'x' version of the macros. e.g.
Code:
include 'win32ax.inc'    
Post 15 Feb 2010, 01:32
View user's profile Send private message Visit poster's website Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
windwakr 15 Feb 2010, 01:34
I think you need to include win32ax.inc/win32wx.inc for it.

If you don't want to include one of those, I think it would be possible to just copy out the "pushd" macro included in it.

_________________
----> * <---- My star, won HERE
Post 15 Feb 2010, 01:34
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 08 Mar 2010, 22:32
so what would I do to use glVertex3f in 64-bit code?
Post 08 Mar 2010, 22:32
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.