News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Glu in windows 10 64 bits compiled with UASM

Started by TouEnMasm, October 27, 2020, 08:06:19 PM

Previous topic - Next topic

TouEnMasm

Hello,
This one is a translated demo from msdn 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

Fa is a musical note to play with CL

TouEnMasm

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 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

Fa is a musical note to play with CL