flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Tyler Durden 28 Apr 2004, 11:27
Hi all
The question is how I can push a dword value to use with OpenGL procedures ? For example with glOrtho ? |
|||
![]() |
|
Tyler Durden 28 Apr 2004, 12:30
But can i use something like glPush in MASM ?
|
|||
![]() |
|
scientica 28 Apr 2004, 13:35
I made a few macros my self some time ago (attachment), they makes life easier to use OpenGLs float funcions (those which use GLfloat).
As for masm, I don't recall how it's done there but iirc the stanard push could handle it. Short description of some of the macros: glPush <GLfloatVar> Push a GLfloat (immediate) value, eg. glPush 1.2f macro glCall <proc name>, [arg] call a procedure, passing *only* immediate GLfloats. macro glPush2 <GLfloatVar> Push a GLfloat variable('s value) which is defined in eg, the .data section. Eg. glPush2 detlaX macro glCall2 <proc>, [arg] call a function, like in glCall, but pass *only* GLfloat variables macro glCall3 <proc>,[arg] An attempt to make one function of glCall and glCall2, tries to sense if it's an immediate valuer or an variable. there are some more macros, you can take a look at them to see glCall2 in use - it was so long time ago since I used them I don't recall how they work, so I'll leave them uncommeneted for now.
_________________ ... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself. - Bradley Kuhn |
|||||||||||
![]() |
|
metalfishx 01 Nov 2004, 12:59
Hello Scientica...
I saw the thread about Windows faq, where you say about this opengl float macros. I have downloaded, and i think you can simplify the macros a little; i mena, you can have only one macro for each situation; for example, instead have glPush and glPush2 you can have for example: Code: macro glPush GLfloatVar { if GLfloatVar eqtype 0.0f virtual at 0 dq GLfloatVar load name.l dword from 0 load name.h dword from 4 end virtual push name.h push name.l else ..name = GLfloatVar push dword [..name+4] push dword [..name] end if } The same with the glCall, right? ![]() Thanks for these macros. Last edited by metalfishx on 04 Nov 2004, 05:35; edited 1 time in total |
|||
![]() |
|
scientica 01 Nov 2004, 15:39
Sure, feel free to shorten them down
![]() |
|||
![]() |
|
metalfishx 04 Nov 2004, 05:33
Hello.
![]() ![]() ![]() Code: macro glPush GLfloatVar { if GLfloatVar eqtype 0.0f virtual at 0 dq GLfloatVar load name.l dword from 0 load name.h dword from 4 end virtual push name.h push name.l else ..name = GLfloatVar push dword [..name+4] push dword [..name] end if } macro glCall proc,[arg] { common if ~ arg eq reverse glPush arg common end if call [proc] } try to do this, and tellme if its ok?.. Code: .... TestF dq 4.232f TestF2 dq 1.2f .... glPush TestF glPush TestF2 glPush 4.232f glPush 1.2f ? Cheers...! ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.