The MASM Forum

Members Gallery => Showcase => Topic started by: TouEnMasm on October 27, 2020, 08:06:19 PM

Title: Glu in windows 10 64 bits compiled with UASM
Post by: TouEnMasm on October 27, 2020, 08:06:19 PM
Hello,
This one is a translated demo from msdn https://docs.microsoft.com/en-us/windows/win32/opengl/the-program-ported-to-win32 (https://docs.microsoft.com/en-us/windows/win32/opengl/the-program-ported-to-win32).
I have let c++ (/FA) do the math labor.

There is some modifies of the original:

bSetupPixelFormat PROC FRAME hdc:HDC
Local pfd:PIXELFORMATDESCRIPTOR,pixelformat:DWORD
invoke memset,addr pfd,0,sizeof pfd ;init of structure for good colors

invoke Sleep,10 ;Slow a little rotations

latitude GLdouble 0       ;instead of GLfloat to be conform with proto
longitude GLdouble 0
latinc GLdouble 0
longinc GLdouble 0

Title: Re: Glu in windows 10 64 bits compiled with UASM
Post by: TouEnMasm on November 07, 2020, 12:39:54 AM
This one is the same code as upper except he use  basic macros for real manipulations.
All macros had been verify by "C language /FA".
The macros works with DWORD,QWORD,REAL4,REAL8
That is enough to use the crt math fonctions here https://docs.microsoft.com/en-us/cpp/c-runtime-library/floating-point-support?view=msvc-160 (https://docs.microsoft.com/en-us/cpp/c-runtime-library/floating-point-support?view=msvc-160) without too many trouble.
Here the list.
Quote
   -------------- FOR all real4 or real8 ,dword or qword -----------------------
   REAL MACRO
   REEL4,REEL8 return NomVar
   MOVR             MOVR near_plane,3.0       ;
   ADDRR             movsd longinc,ADDRR (longinc,reel805) or movsd longinc,ADDRR (longinc,0.5)
   SUBRR                 //     SUBRR //
   DIVRR,MULRR    movsd moins,MULRR(aradius,REEL8(-1.0))
   convert Integer to Real,Convert Real to Integer
   CONVERTIR,CONVERTRI          QWORD to real8 or real4        DWORD to REAL4 or REAL 8 ,...........
            movsd rhauteur,CONVERTR(hauteur,1)      ;1 increase or Decrease ,0 same size