Hi everybody,
I've been reading this board for quite a while now and I finally got around to post something (I was too lazy to click on the register button :tongue: ). Anyway, I've started using assembly for all my projects (not that I have a lot), and I'd really like to be able to use OpenGL. I've already tried Masm, but I find it too big for my taste (besides, I like to have the source of all the tools I'm using). I was thinking if it was possible, with fasm's macroinstructions, to ease the use of OpenGL with something like glCallf or glCalld (like the ones found in bizzarecreations' gl includes files) which declares floating-point variables and push them on the stack for use with the call instruction (I have a C background, hence the description I'm making of this concept, correct me if I use inappropriate terms). I already started *trying* to create them, but my limited knowledge of assembly and fasm makes it difficult for me to get something working in that area.
The point is, can anyone help me with that problem, or give me directions if it was already solved by one of you guys?
P.S: How can Privalov answer all those questions and bug reports so fast?!? :eek: Is he a god, or does he simply pay a few code monkeys to help him? ;)
I've been reading this board for quite a while now and I finally got around to post something (I was too lazy to click on the register button :tongue: ). Anyway, I've started using assembly for all my projects (not that I have a lot), and I'd really like to be able to use OpenGL. I've already tried Masm, but I find it too big for my taste (besides, I like to have the source of all the tools I'm using). I was thinking if it was possible, with fasm's macroinstructions, to ease the use of OpenGL with something like glCallf or glCalld (like the ones found in bizzarecreations' gl includes files) which declares floating-point variables and push them on the stack for use with the call instruction (I have a C background, hence the description I'm making of this concept, correct me if I use inappropriate terms). I already started *trying* to create them, but my limited knowledge of assembly and fasm makes it difficult for me to get something working in that area.
The point is, can anyone help me with that problem, or give me directions if it was already solved by one of you guys?
P.S: How can Privalov answer all those questions and bug reports so fast?!? :eek: Is he a god, or does he simply pay a few code monkeys to help him? ;)
The attached file contains some OpenGL equated converted for fasm by Anvar Sosnitski.
You should not have any problems with the floating-point values, because with fasm they can be used everywhere in place of any other number expression. For example you can provide the immediate floating-point value as an parameter for "invoke" macro.
PS. To reduce costs on monkeys I do it all myself.
You should not have any problems with the floating-point values, because with fasm they can be used everywhere in place of any other number expression. For example you can provide the immediate floating-point value as an parameter for "invoke" macro.
PS. To reduce costs on monkeys I do it all myself.
:eek:... :alright:
Thanks for the fast answer! It works well with normal floating-point numbers, but not when it ends with 'f'.
Ex: invoke glClearDepth, 1.0f
Most OpenGL calls in C/C++ uses this syntax, and it would make easier porting to fasm if it would be accepted. :)
Anyway, sorry for requesting help before trying it out myself, I assumed it was not working this way because Masm and Nasm don't have this built-in. Keep up the good work! :alright:
Thanks for the fast answer! It works well with normal floating-point numbers, but not when it ends with 'f'.
Ex: invoke glClearDepth, 1.0f
Most OpenGL calls in C/C++ uses this syntax, and it would make easier porting to fasm if it would be accepted. :)
Anyway, sorry for requesting help before trying it out myself, I assumed it was not working this way because Masm and Nasm don't have this built-in. Keep up the good work! :alright:
1.0f is supported now.
Thanks! :alright:
Now what about 0.9f, 0.8f, etc... j/k ;)
Now what about 0.9f, 0.8f, etc... j/k ;)
:grin:
Hmm... all in place floating-point values are converted to dword format, but some ogl functions require 64-bit values (qword). Wouldn't it be possible to support them aswell? The idea would simply be to make the assembler format the floating point to a qword value and let us access the hi-dword or the low-dword. Maybe something like this:
invoke glFunction, low(1.0d), hi(1.0d)
which would be the same as using
fp_value dq 1.0
invoke glFunction, dword , dword
But then again, I guess a macro could accomplish this work. Any suggestions?
invoke glFunction, low(1.0d), hi(1.0d)
which would be the same as using
fp_value dq 1.0
invoke glFunction, dword , dword
But then again, I guess a macro could accomplish this work. Any suggestions?
struc equq value
{
virtual at 0
dq value
load .low dword from 0
load .high dword from 4
end virtual
}
pi equq 3.14159265358979
invoke glFunction, pi.low, pi.high
thx :) it's not exactly what I needed, but will do nicely :alright:
I'm pretty sure it's exaclty what you asked for. It defines constants, not data.