The MASM Forum

Microsoft 64 bit MASM => Mikl__'s ml64 examples => Topic started by: Mikl__ on May 02, 2020, 05:08:37 PM

Title: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:08:37 PM
example of the standard FASM, there are Opengl32.inc, Glu32.inc, Glut32.inc, asm-file, cursor and exe-file in attachemnt.
;                        Y-axis
;    4-th vertex violet  |   3-rd vertex blue
;           -0.6,0.6     |      0.6,0.6
;               +--------+--------+
;               |        |        |
;               |        |        |
;               |        |0.0,0.0 |
;           ----+--------+--------+-----X-axis
;               |        |        |
;               |        |        |
;               +--------+--------+
;           -0.6,-0.6    |     0.6,-0.6
;    1-st vertex red     |   2-nd vertex dark
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:12:52 PM
OpenGl asm blank text; GUI #
include win64a . inc
; ---------------
WINDOWWIDTH = 440
WINDOWHEIGHT = 400
. code
Winmain proc
msg local : by MSG
xor ebx , ebx
        mov edi , offset szClassName
        mov esi , IMAGE_BASE
        mov ecx , offset FileName
invoke LoadCursorFromFile
        push rax ; hIconSm
push rdi ; lpszClassName
push rbx ; lpszMenuName
push COLOR_WINDOWTEXT + 1 ; hbrBackground
push rax ; hCursor
push rax        ; hIcon
push rsi ; hInstance
push rbx        ; cbClsExtra & cbWndExtra
pushaddr WndProc ; lpfnWndProc
push sizeof WNDCLASSEX       ; cbSize & style
    invoke RegisterClassEx , esp ; addr WNDCLASSEX
push rbx
push rsi ; rsi = 400000h
shl esi , 9 ; rsi = CW_USEDEFAULT
push rbx
push rbx
push WINDOWHEIGHT
push WINDOWWIDTH
push rsi
push rsi
sub esp , 20h
    invoke CreateWindowEx , 0 , edi , edi , WS_OVERLAPPEDWINDOW or WS_CLIPCHILDREN or WS_CLIPSIBLINGS or WS_VISIBLE
; message loop
    lea edi , msg
@@ : invoke GetMessage , edi , 0 , 0 , 0
cmp msg . wParam , VK_ESCAPE ; user press 'Esc'?
je wmDESTROY
invoke DispatchMessage , edi
jmp @b
Winmain endp
WndProc proc hWin : QWORD , uMsg : QWORD , wParam : QWORD , lParam : QWORD
        mov hWin , rcx
        cmp edx , WM_CREATE
je      wmCREATE
        cmp edx , WM_SIZE
je      wmSIZE
        cmp edx , WM_PAINT
je      wmPAINT
        cmp edx , WM_DESTROY
je      wmDESTROY 
defa ult : leave
jmp NtdllDefWindowProc_
wmDESTROY :: invoke wglMakeCurrent , 0 , 0
invoke wglDeleteContext , hrc
invoke ReleaseDC , hWin , hDC
invoke RtlExitUserProcess , NULL
wmCREATE : invoke GetDC ; get the window context
mov hDC , rax
; initialize the OpenGL pixel format descriptor (support for OpenGL and dual
; buffering) select it
        mov edx , offset PixFrm
invoke ChoosePixelFormat , eax
; and install it
mov r8d , offset PixFrm
invoke SetPixelFormat , hDC , eax
; convert the window context to the OpenGL context
invoke wglCreateContext , hDC
mov hrc , rax
; and make it current
invoke wglMakeCurrent , hDC , eax
; choose the mode of calculating perspective transformations (best)
invoke glHint , GL_PERSPECTIVE_CORRECTION_HINT , GL_NICEST ;
; choose a perspective projection matrix for transformations
invoke glMatrixMode , GL_PROJECTION ; selects the active matrix from the list (stack)
; multiply it by the perspective matrix, i.e. just turn it on (use the glcall macro since parameters are transmitted as 8 bytes)
movq xmm0 , constd90_0
movq xmm1 , ratio
movq xmm2 , constd0_1
movq xmm3 , constd100_0
invoke gluPerspective
; choose the image matrix for transformations
invoke glMatrixMode , GL_MODELVIEW ; selects the active matrix from the list (stack)
        jmp wmBYE
wmSIZE : ; --------------- Resize the scene
movzx r8 , r9w
shr r9 , 16
invoke glViewport , 0 , 0 ; Change the image display window
        jmp wmBYE
wmPAINT : ; No pending messages: draw the scene
; --------------- Display the scene
; clear the screen buffer
invoke glClear , GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT
; zero the current matrix (image matrix)
invoke glLoadIdentity
; move objects deep into the screen (z = -5 and left x = -1.5)
movd xmm0 , const_1_5 ; ebx
movd xmm1 , ebx
movd xmm2 , const_5_0
invoke glTranslatef
        invoke glFlush
; display the buffer on the screen
        invoke SwapBuffers , hDC
wmBYE : leave
retn
Wndproc endp
hDC dq ?
hrc dq ?
PixFrm label PIXELFORMATDESCRIPTOR
PixFrm label PIXELFORMATDESCRIPTOR
  nSize             dw sizeof PIXELFORMATDESCRIPTOR ; data structure size
  nVersion           dw 1 ; data structure version
  dwFlags           dd PFD_SUPPORT_OPENGL or PFD_DOUBLEBUFFER or \
PFD_DRAW_TO_WINDOW ; A set of bit flags that specify the properties of the point buffer
  iPixelType         db PFD_TYPE_RGBA ; Requires RGBA format
  cColorBits         db 32 ; Selects a bit of color depth
  cRedBits           db 0
  cRedShift         db 0
  cGreenBits         db 0
  cGreenShift       db 0
  cBlueBits         db 0
  cBlueShift         db 0 ; Ignore color bits
  cAlphaBits         db 0 ; No transparency buffer
  cAlphaShift       db 0 ; Shift bit is ignored
  cAccumBits         db 0 ; No accumulation buffer
  cAccumRedBits     db 0
  cAccumGreenBits   db 0
  cAccumBlueBits     db 0
  cAccumAlphaBits   db 0 ; Accumulation bits are ignored
  cDepthBits         db 32 ; 32 bit Z-buffer (depth buffer)
  cStencilBits       db 0 ; No stencil buffer
  cAuxBuffers       db 0 ; No auxiliary buffers
  iLayerType         db PFD_MAIN_PLANE ; Main drawing layer
  bReserved         db 0 ; Reserved
  dwLayerMask       dd 0
  dwVisibleMask     dd 0
  dwDamageMask       dd 0 ; Layer masks are ignored
szClassName db "Uncle Remus tales: #40 OpenGL" , 0
FileName db "Images\br_Rabbit3.cur" , 0
ratio dq 1.1 ; 440/400
const_1_5 dd - 1.5
const_5_0 dd - 5.0
constd90_0 dq 90.0
constd0_1 dq 0.1
constd100_0 dq 100.0
end
bat-filecls
set masm64_path=\masm43\
set filename=%~n1
if exist errors.txt del errors.txt
call :read_settings %filename%
@echo %kind_of_file%
goto %kind_of_file%
:CONSOLE
if exist %filename%.exe del %filename%.exe
if exist %filename%.obj del %filename%.obj
if exist errors.txt del errors.txt
%masm64_path%bin\ml64 /Cp /c /I"%masm64_path%Include" %filename%.asm >> errors.txt
if errorlevel 1 exit
if exist %1.rc (
%masm64_path%bin\RC /r /i"%masm64_path%\Include" %filename%.rc >> errors.txt
%masm64_path%bin\link /LIBPATH:"%masm64_path%Lib" ^
/LARGEADDRESSAWARE:NO /BASE:0x400000 /STUB:%masm64_path%bin\stubby.exe ^
/SECTION:.text,W /ALIGN:16 /entry:WinMain /MERGE:.rdata=.text ^
/fixed /nocoffgrpinfo %filename%.obj %filename%.res >> errors.txt
if exist %1.res del %1.res
) else (
%masm64_path%bin\link /SUBSYSTEM:CONSOLE /LIBPATH:"%masm64_path%Lib" ^
/entry:WinMain %filename%.obj /LARGEADDRESSAWARE:NO ^
/ALIGN:16 /SECTION:.text,W /BASE:0x400000 /STUB:%masm64_path%\bin\stubby.exe >> errors.txt
)
if errorlevel 1 exit
del %filename%.obj
goto exit1
:GUI
if exist %filename%.exe del %filename%.exe
if exist %filename%.obj del %filename%.obj
if exist errors.txt del errors.txt
%masm64_path%bin\ml64 /Cp /c /I"%masm64_path%Include" %filename%.asm >> errors.txt
if errorlevel 1 exit
if exist %1.rc (
%masm64_path%bin\RC /r /i"%masm64_path%\Include" %filename%.rc >> errors.txt
%masm64_path%bin\link /LIBPATH:"%masm64_path%Lib" ^
/LARGEADDRESSAWARE:NO /BASE:0x400000 /STUB:%masm64_path%bin\stubby.exe ^
/SECTION:.text,W /ALIGN:16 /entry:WinMain ^
/fixed /nocoffgrpinfo %filename%.obj %filename%.res >> errors.txt
if exist %1.res del %1.res
) else (
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:"%masm64_path%Lib" ^
/LARGEADDRESSAWARE:NO /BASE:0x400000 /STUB:%masm64_path%bin\stubby.exe ^
/SECTION:.text,W /ALIGN:16 /entry:WinMain /MERGE:.rdata=.text ^
/fixed /nocoffgrpinfo %filename%.obj >> errors.txt
)
if errorlevel 1 exit
goto exit1
:DLL
if exist %filename%.dll del %filename%.dll
%masm64_path%bin\ml64 /c /Cp /I %masm64_path%include %filename%.asm >> errors.txt
if errorlevel 1 exit
if exist %1.rc (
%masm64_path%bin\RC /r  %filename%.rc >> errors.txt
if errorlevel 1 exit
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:%masm64_path%lib ^
/ENTRY:DllMain /DLL /DLL /section:.bss,S /stub:%masm64_path%bin\stubby.exe  ^
%filename%.obj %filename%.res /DEF:%filename%.def >> errors.txt
if exist %1.res del %1.res
) else (
%masm64_path%bin\link /SUBSYSTEM:WINDOWS /LIBPATH:%masm64_path%lib ^
/ENTRY:DllMain /DLL /DLL /section:.bss,S /stub:%masm64_path%bin\stubby.exe  ^
%filename%.obj /DEF:%filename%.def >> errors.txt
)
if errorlevel 1 exit
del %filename%.exp
:exit1
del %filename%.obj
del errors.txt
:: %filename%.exe
exit
:read_settings
for /f "eol=# tokens=2-3" %%A in (%filename%.asm) do (
set kind_of_file=%%A
if %%B == # exit /b )
exit /b
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:16:11 PM
We draw a triangle, there are asm-file, cursor, exe-file and win64a.inc in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:18:53 PM
triangle and rectangle, there are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:21:39 PM
Colored triangle and rectangle. There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:24:21 PM
Rotating triangle and the rectangle. There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:26:50 PM
From four triangles we make a rotating tetrahedron (a pyramid in which all faces are equilateral triangles). There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:31:03 PM
This program demonstrates using mipmaps for texture maps. To overtly show the effect of mipmaps, each mipmap reduction level has a solidly colored, contrasting texture image. Thus, the quadrilateral which is drawn is drawn with several different colors. There are asm-file, cursor and exe-file in the attachment. A prototype is model.c from https://www.opengl.org/archives/resources/code/samples/redbook/
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:32:41 PM
This program demonstrates vertex arrays. There are asm-file, cursor and exe-file in the attachment. A prototype is varray.c from https://www.opengl.org/archives/resources/code/samples/redbook/
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:34:07 PM
This program demonstrates using mipmaps for texture maps. To overtly show the effect of mipmaps, each mipmap reduction level has a solidly colored, contrasting texture image. Thus, the quadrilateral which is drawn is drawn with several different colors. A prototype is mipmap.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:35:53 PM
Points, lines, triangle, rectangles, pentagon. There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:37:56 PM
A rewrited example from the "FASM OpenGL tutorial from Tyler Durden"
Motion blur - blurring the image when you rotate the camera, play back motion scenes or fast moving objects. Rendering is the process of obtaining an image from a model using a computer program. There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:39:56 PM
Redesigned example from the "FASM OpenGL tutorial from Tyler Durden". Texturing is a stage in the process of creating and visualizing a 3D model, which allows you to give the surface of an object certain parameters and properties in order to obtain maximum realism. There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:41:51 PM
Rewrited example from the "FASM OpenGL tutorial from Tyler Durden"
alpha-blending is a transparency effect. In the attachment, the asm-file, cursor, raw file and exe
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:43:57 PM
Reworked example from the "FASM OpenGL tutorial from Tyler Durden"
The Fog. In the attachment, the asm-file, cursor, raw-file, opengl32.inc and exe-file
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:45:59 PM
Converted example from the tutorial Igor Tarasov "OpenGL Fundamentals" lamps.c There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:47:15 PM
This program demonstrates some characters of a stroke (vector) font. The characters are represented by display lists, which are given numbers which correspond to the ASCII values of the characters. Use of glCallLists() is demonstrated. A prototype is stroke.c from https://www.opengl.org/archives/resources/code/samples/redbook/ . There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 02, 2020, 05:49:03 PM
This is a simple, introductory OpenGL program. A prototype is hello.c from https://www.opengl.org/archives/resources/code/samples/redbook/ . There are asm-file, cursor and exe-file in the attachment.



Title: Re: OpenGL in masm64
Post by: avcaballero on May 02, 2020, 05:55:06 PM
Very interesting, Mikl  :thumbsup:
Title: Re: OpenGL in masm64
Post by: mabdelouahab on May 03, 2020, 01:49:42 AM
 :thumbsup:
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 03, 2020, 02:13:13 PM
This program demonstrates the use of the GL lighting model. Several objects are drawn using different material characteristics. A single light source illuminates the objects. A prototype is material.c from https://www.opengl.org/archives/resources/code/samples/redbook/ . There are asm-file, cursor and exe-file in the attachment. May be need glut32.dll It is in attachment too
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 03, 2020, 05:48:52 PM
This program uses evaluators to draw a Bezier curve. A prototype is bezcurve.c from https://www.opengl.org/archives/resources/code/samples/redbook/ . There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 03, 2020, 07:02:49 PM
This program demonstrates how to make and execute a display list. Note that attributes, such as current color and matrix, are changed.
A prototype is list.c from https://www.opengl.org/archives/resources/code/samples/redbook/ . There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 03, 2020, 11:57:36 PM
This program demonstrates geometric primitives and their attributes. A prototype is lines.c from https://www.opengl.org/archives/resources/code/samples/redbook/ . There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 04, 2020, 01:05:17 AM
Converted example from the tutorial Igor Tarasov "OpenGL Fundamentals" primitive.c There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 05, 2020, 11:12:10 AM
Converted example from the tutorial Igor Tarasov "OpenGL Fundamentals" sphere2.c There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 07, 2020, 01:55:34 PM
This program demonstrates the use of some of the gluQuadric* routines. Quadric objects are created with some quadric properties and the callback routine to handle errors. Note that the cylinder has no top or bottom and the circle has a hole in it. A prototype is quadric.c from https://www.opengl.org/archives/resources/code/samples/redbook/  There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 07, 2020, 02:01:04 PM
Converted example from the tutorial Igor Tarasov "OpenGL Fundamentals" quadric.c There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Siekmanski on May 07, 2020, 02:18:58 PM
Cool examples!  :cool:
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 07, 2020, 02:53:10 PM
This program demonstrates the use of the OpenGL lighting model. A sphere is drawn using a grey material characteristic. A single light source illuminates the object. A prototype is light.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 07, 2020, 04:15:26 PM
After initialization, the program will be in ColorMaterial mode. Interaction: pressing the mouse buttons will change the diffuse reflection values.
A prototype is colormat.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 07, 2020, 05:31:24 PM
Flying and rotating cubes. There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 07, 2020, 06:48:46 PM
This program demonstrates the use of the GL lighting model. Objects are drawn using a blue material characteristic. A single light source illuminates the objects. A prototype is scene.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: six_L on May 08, 2020, 12:51:25 AM
GLUT32.DLL
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 08, 2020, 09:43:05 AM
Hi, six_L!
Thank you very much, but I uploaded GLUT32.DLL in Replay #20 (http://masm32.com/board/index.php?topic=8514.msg93147#msg93147)


This program demonstrates when to issue lighting and transformation commands to render a model with a light which is moved by a modeling transformation (rotate or translate). The light position is reset after the modeling transformation is called. The eye position does not change. A sphere is drawn using a grey material characteristic. A single light source illuminates the object. Interaction: pressing the left mouse button alters the modeling transformation (x rotation) by 30 degrees. The scene is then redrawn with the light in a new position.
A prototype is movelight.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 08, 2020, 05:50:44 PM
A prototype is OpenGL.asm by Franck Charlet from masm32\examples64\opengl There are asm-file, cursor and exe-file in the attachment.
hutch--
please correct, you have a 32-bit program in examples64 (https://wasm.in/styles/smiles_s/mosking.gif)
Title: Re: OpenGL in masm64
Post by: jj2007 on May 08, 2020, 06:31:00 PM
Hi Mikl,

You are posting great stuff :thumbsup:

Excuse my ignorance: OpenGL does not have anti-aliasing like Gdi+?
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 08, 2020, 06:37:49 PM
Ciao, jj2007
non lo so ancora. Ho iniziato a studiare OpenGL solo due settimane e non so tutte le complessità di questo sistema (https://wasm.in/styles/smiles_s/scratch_one-s_head.gif)
Title: Re: OpenGL in masm64
Post by: six_L on May 08, 2020, 06:52:42 PM
Hi,Mikl__
nice work!
sorry, i did not pay attention to the GLUT32.DLL in Replay #20
Title: Re: OpenGL in masm64
Post by: jj2007 on May 08, 2020, 10:48:41 PM
Quote from: Mikl__ on May 08, 2020, 06:37:49 PM
Ciao, jj2007
non lo so ancora. Ho iniziato a studiare OpenGL solo due settimane e non so tutte le complessità di questo sistema (https://wasm.in/styles/smiles_s/scratch_one-s_head.gif)

Complimenti per il tuo italiano ;-)

I am looking forward to your next posts, Mikl :thumbsup:
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 08, 2020, 11:06:36 PM
ho provato (https://wasm.in/styles/smiles_s/blush2.gif) Presto si dice una fiaba, ma si fa una cosa non presto (Скоро сказка сказывается, да не скоро дело делается)
Title: Re: OpenGL in masm64
Post by: HSE on May 09, 2020, 02:15:36 AM
Hi Mikl__!




Sorry, just now I realize that is for fasm  :biggrin: :biggrin:

ml64 don't allow movf8.

Regards. HSE
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 09, 2020, 02:27:03 AM
Hi, HSE!
you need file %masm64_path%include\opengl32.inc and %masm64_path%include\win64a.inc
Title: Re: OpenGL in masm64
Post by: avcaballero on May 09, 2020, 02:41:54 AM
Mikl, we want more!
Mikl, we want more!
Mikl, we want more!
Mikl, we want more!
Mikl, we want more!
Mikl, we want more!

:biggrin:  :greenclp:

By the way, I think there's in this forum all the folders and files to compile with ml64, but I dont't find it... Do you mind if...
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 09, 2020, 02:56:16 AM
¡Buena noches caballero!
Mira aqui (https://translate.google.com/translate?sl=ru&tl=es&u=https%3A%2F%2Fwasm.in%2Fthreads%2Fmasm-64-sborka.32766%2F)
presta atención al mensaje número 8
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 09, 2020, 11:25:07 AM
This program demonstrates the creation of a display list. Rotate about x-axis when "x" or "X" typed; rotate about y-axis when "y" or "Y" typed; "i" or "I" returns torus to original view. A prototype is torus.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 11, 2020, 02:28:46 PM
This program draws 5 red balls, each at a different Z-distance from the viewer, in different types of fog. This program chooses between 3 types of fog when "f" or "F" typed: In this program, there is a fixed density value, as well as fixed start and end values for the linear fog. A prototype is fog.c  from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 11, 2020, 08:13:53 PM
A prototype is Flat Rendering.asm by Franck Charlet. There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 11, 2020, 11:35:56 PM
This program shows how to composite modeling transformations to draw translated and rotated models. Interaction: pressing the "d" (day) (rotation of a satellite planet around its axis clockwise), "D" (rotation of a satellite planet around its axis counterclockwise) and "y" (year) (clockwise rotation of a satellite planet around a large planet) and "Y" (rotation of a satellite planet around a large planet counterclockwise). A prototype is planet.c  from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: felipe on May 12, 2020, 02:39:04 AM
Mikl_ looks that you are a genius, this is really great stuff  :greenclp:. I will be trying all this demos...I already tried the first one and runs with no problems here (in my pc). Nice that you are still developing and sharing your software.. :thup: :thup: Btw i didn't recall you had your "own" category in the forum (i mean "Mikl__'s ml64 examples"). You sure deserve it. Thanks a lot man!  :thup: :greensml:
Title: Re: OpenGL in masm64
Post by: felipe on May 12, 2020, 03:23:19 AM
Second example works fine too  :thumbsup:. Didn't know that opengl32.dll is already in the system. And looks that there are no needs to install any extra software to run all this cool demos. So i think that opengl is less bloated/less work than what it is directx...Any thoughts on this comparison?  :icon_idea:
Title: Re: OpenGL in masm64
Post by: HSE on May 12, 2020, 06:02:26 AM
Hi Mikl__!

I solved first problem: Ml64 don't know :movq xmm1,rax
In ml64 must be :movd xmm1, rax
:biggrin: very ... something

Now I found I don't have glut32.lib

Where you find that?

Thanks
Title: Re: OpenGL in masm64
Post by: felipe on May 12, 2020, 06:49:13 AM
I just tried the 31.zip. Great stuff. I think opengl is really a worth to try. Nice Mikl__  :thup: one more time, thanks.  :greenclp:
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 12, 2020, 09:44:20 AM
¡Hola, felipe!
¡Muchas gracias!
QuoteNow I found I don't have glut32.lib Where you find that?
Hi, HSE! Are you from the USA?
I made it myself (https://wasm.in/styles/smiles_s/blush2.gif)
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 12, 2020, 04:40:10 PM
This program demonstrates arbitrary clipping planes. A prototype is clip.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: HSE on May 12, 2020, 10:29:25 PM
Quote from: Mikl__ on May 12, 2020, 09:44:20 AM
Are you from the USA?
No. Almost so lazzy  :biggrin:

Quote from: Mikl__ on May 12, 2020, 09:44:20 AMI made it myself (https://wasm.in/styles/smiles_s/blush2.gif)
I failed to build glut in 32 bit. I'am not going to try in 64 bit  :undecided:. But in 32 bit there is a building available.
I just play in 64 bits from time to time. This examples make that more interesting.
Thanks MIkl__  :thumbsup:
Title: Re: OpenGL in masm64
Post by: nidud on May 13, 2020, 12:14:53 AM
deleted
Title: Re: OpenGL in masm64
Post by: HSE on May 13, 2020, 01:11:01 AM
Thanks. I will test next time in 64bits.  :thumbsup:
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 13, 2020, 04:14:43 PM
The program demonstrates polygon stippling. A prototype is polys.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 14, 2020, 10:42:38 AM
This is an illustration of the selection mode and name stack, which detects whether objects which collide with a viewing volume. First, four triangles and a rectangular box representing a viewing volume are drawn (drawScene routine). The green triangle and yellow triangles appear to lie within the viewing volume, but the red triangle appears to lie outside it. Then the selection mode is entered (selectObjects routine). Drawing to the screen ceases. To see if any collisions occur, the four triangles are called. In this example, the green triangle causes one hit with the name 1, and the yellow triangles cause one hit with the name 3.
A prototype is select.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 14, 2020, 12:50:19 PM
Based on "Hidden Lines" by Franck Charlet. Rotating cubic structure. There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 15, 2020, 10:49:41 PM
This program draws a NURBS surface in the shape of a symmetrical hill.  The 'c' keyboard key allows you to toggle the visibility of the control points themselves. Note that some of the control points are hidden by the surface itself. A prototype is surface.c  from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 15, 2020, 10:54:03 PM
This program draws a NURBS surface in the shape of a symmetrical hill, using both a NURBS curve and pwl (piecewise linear) curve to trim part of the surface. A prototype is trim.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 16, 2020, 02:42:45 PM
Draws the bitmapped letter F on the screen (several times). This demonstrates use of the glBitmap() call  A prototype is drawf.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 16, 2020, 02:47:20 PM
Based on "Text 2D" by Franck Charlet. There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 16, 2020, 02:54:02 PM
Based on "Text 3D" by Franck Charlet. There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 17, 2020, 01:45:14 AM
 "Text 3D". A rewrited example from the "FASM OpenGL tutorial from Tyler Durden". There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: avcaballero on May 17, 2020, 02:24:24 AM
Good samples, Mikl  :thumbsup:. I have tried to find the Tyler Durden's OpenGL tuto, but no success. It seems that the original site is down, do you have any working link?
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 17, 2020, 02:28:23 AM
Buenas tardes Alfonso!
I have a copy of this tutor in Russian
Title: Re: OpenGL in masm64
Post by: avcaballero on May 17, 2020, 02:32:37 AM
Oh, great, and if it is in Russian, even better  :thumbsup: Just need a link  :biggrin:
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 17, 2020, 02:37:58 AM
now I have a deep night, morning I will collect html-files and lay out this tutor in this topic
¡Encontró! Enlace al libro de texto del Tyler Durden
http://www.comprog.ru/OpenGL/article_4172.htm
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 17, 2020, 01:25:07 PM
Release the Kraken (https://wasm.in/styles/smiles_s/mosking.gif)
A rewrited example 1k_tentacle from the http://www.pouet.net/prod.php?which=20203 There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 20, 2020, 10:07:08 PM
Rotating primitives, based on "Lists and GLU Primitives" by Franck Charlet. There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 20, 2020, 11:07:23 PM
Torus. Rotate about x-axis when "x" or "X" typed; rotate about y-axis when "y" or "Y" typed; "i" or "I" returns torus to original view. A prototype is torus.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 21, 2020, 11:27:17 AM
Converted example from the tutorial Igor Tarasov "OpenGL Fundamentals" stencil.c There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 21, 2020, 09:25:00 PM
Stencil Buffer. This program draws two rotated tori in a window. A diamond in the center of the window masks out part of the scene. Within this mask, a different model (a sphere) is drawn in a different color. This program demonstrates use of the stencil buffer for masking nonrectangular regions. Whenever the window is redrawn, a value of 1 is drawn into a diamond-shaped region in the stencil buffer.  Elsewhere in the stencil buffer, the value is 0.  Then a blue sphere is drawn where the stencil value is 1, and yellow torii are drawn where the stencil value is not 1. A prototype is stencil.c  from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 22, 2020, 10:02:20 PM
Not interested? You'll write about it, please (https://wasm.in/styles/smiles_s/scratch_one-s_head.gif)
Title: Re: OpenGL in masm64
Post by: Siekmanski on May 22, 2020, 10:18:18 PM
Cool examples, and you're a very fast coder.  :thumbsup:
Great resource for starting game coders, much respect!
Title: Re: OpenGL in masm64
Post by: avcaballero on May 22, 2020, 11:04:14 PM
I'm a Mikl's OpenGL examples addicted  :thumbsup: Please, go ahead
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 23, 2020, 11:17:44 AM
A prototype is "Alpha Blend Texture.asm" by Franck Charlet. There are asm-file, cursor, bmp-file and exe-file in the attachment
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 23, 2020, 01:46:47 PM
A prototype is "Display BMP.asm" by Franck Charlet. There are asm-file, cursor, bmp-file and exe-file in the attachment. The main thing to remember is that the image width and height in bmp-file must be a power of two (4(=22), 8(=23), 16(=24), 32(=25), 64(=26), 128(=27), 256(=28), 512(=29) pixels etc.)
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 24, 2020, 01:07:49 PM
This program draws several overlapping filled polygons to demonstrate the effect order has on alpha blending results. Use the 't' or 'T' key to toggle the order of drawing polygons. A prototype is alpha.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 26, 2020, 12:04:38 AM
The vertex array is almost same as the commands between glBegin/glEnd, only the map itself executes them, substituting the values ​​from our array. We necessary to describe not only the vertices, but also the normals, texture coordinates, color, and so arrays are different. However, we will not torment ourselves by connecting all arrays, we just throw everything into the heap with the glInterleavedArrays function (that is, the data in the array goes sequentially, first the normal of one vertex, then its texture coordinates, color, etc. then the vertex coordinates themselves. Then, too most for the next peak, etc.) It takes parameters as the type of "piled up" arrays, here it is GL_N3F_V3F, that is, N3F is an array of normals, 3 floats per normal and V3F an array of vertices, also of 3 floats per vertex, the so-called "stride" - distance "between the data for the neighboring vertex (we will have" 0 "since the data in the array goes in a row), and finally, a link to the data array (textureBlank). But glInterleavedArrays only connects arrays to display, they still need to be mapped. This is done with the glDrawArrays function. A rewrited example varrays.asm from the "FASM OpenGL tutorial from Tyler Durden". There are asm-file, bin-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 26, 2020, 12:34:11 PM
This program renders a lighted, filled Bezier surface, using two-dimensional evaluators. A prototype is bezmesh.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 26, 2020, 01:36:12 PM
This program renders a wireframe Bezier surface, using two-dimensional evaluators. A prototype is  bezsurf.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 26, 2020, 04:04:54 PM
This program uses evaluators to generate a curved surface and automatically generated texture coordinates. A prototype is texturesurf.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 26, 2020, 07:00:21 PM
This program demonstrates polygon offset to draw a shaded polygon and its wireframe counterpart without ugly visual artifacts ("stitching"). A prototype is polyoff.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.

Interaction:
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 27, 2020, 02:39:36 PM
This program demonstrates a single modeling transformation, glScalef() and a single viewing transformation, gluLookAt(). A wireframe box is rendered. A prototype is cube.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 29, 2020, 02:27:27 AM
A simple example of using accumulation buffer to do full-scene antialiasing on a scene with orthographic parallel projection. A prototype is accanti.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 29, 2020, 02:13:31 PM
Use the accumulation buffer to do full-scene antialiasing on a scene with perspective projection, using the special routines accFrustum() and accPerspective(). A prototype is accpersp.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 30, 2020, 02:17:19 AM
This program shows how to draw anti-aliased lines. It draws two diagonal lines to form an X when 'r' or 'R' is typed in the window, the lines are rotated in opposite directions. A prototype is aargb.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 30, 2020, 12:49:50 PM
A prototype is "Spot Light" by Franck Charlet. There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 30, 2020, 10:48:25 PM
Stainless steel cylinder. A prototype is "Sphere Mapping" by Franck Charlet. There are asm-file, cursor, bmp-file for texture and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 31, 2020, 12:02:26 AM
This program texture maps a checkerboard image onto two rectangles. This program clamps the texture, if the texture coordinates fall outside 0.0 and 1.0. A prototype is checker.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 31, 2020, 11:57:30 AM
This program shows how to composite modeling transformations to draw translated and rotated hierarchical models.  A prototype is robot.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Interaction: pressing the "s", "S", "E" and "e" keys (shoulder and elbow) alters the rotation of the robot arm.
Title: Re: OpenGL in masm64
Post by: Mikl__ on May 31, 2020, 09:47:27 PM
Graphic primitives. This program demonstrates polygon tessellation. Two tesselated objects are drawn. The first is a rectangle with a triangular hole. The second is a smooth shaded, self-intersecting star. Note the exterior rectangle is drawn with its vertices in counter-clockwise order, but its interior clockwise. Note the combineCallback is needed for the self-intersecting star. Also note that removing the TessProperty for the star will make the interior unshaded (WINDING_ODD). A prototype is tess.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 03, 2020, 08:09:47 PM
It is a small holiday today - I have 900-th post in masm32.com forum (https://wasm.in/styles/smiles_s/party.gif) (http://www.kolobok.us/smiles/artists/vishenka/d_martini.gif) It's a pity that there is no feedback ...
Title: Re: OpenGL in masm64
Post by: TimoVJL on June 04, 2020, 12:38:46 AM
Congratulations :biggrin:
I watched a some of a your examples :thumbsup:
Title: Re: OpenGL in masm64
Post by: jj2007 on June 04, 2020, 01:09:21 AM
Quote from: Mikl__ on June 03, 2020, 08:09:47 PMIt's a pity that there is no feedback ...

Dear Mikl,

Congrats to your 900th post  :thumbsup:

There is no feedback because we are watching with awe what you produce every day. Most of us are simply not able to follow you... sincere compliments, this is great stuff :thup:
Title: Re: OpenGL in masm64
Post by: felipe on June 04, 2020, 01:20:41 AM
Quote from: jj2007 on June 04, 2020, 01:09:21 AM
Most of us are simply not able to follow you...

That's my case too, especially because i just don't have the time  :sad:. But let me tell you: you have done a great job!  :greenclp:.
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 04, 2020, 06:12:22 PM
Hi, TimoVJL, jj2007, felipe!
Thanks a lot!
There are asm-file, cursor, raw-file for texture and exe-file in the attachment
Interaction:
Hi, hutch--!
I will can make a planet with only one continent "Australia" and a satellite of such a planet with the continent "New Zealand" (https://wasm.in/styles/smiles_s/mosking.gif) I feel myself the creator of the universe!
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 05, 2020, 04:11:04 PM
There is where to strive for something (https://wasm.in/styles/smiles_s/mosking.gif)
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 06, 2020, 08:26:00 PM
Per aspera ad astra
A few handfuls of stars and the picture came to life. There are asm-file, cursor, bin-file and exe-file in the attachment
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 10, 2020, 08:55:03 PM
This program demonstrates how to intermix opaque and alpha blended polygons in the same scene, by using glDepthMask. Press the 'a' or 'A' keys to animate moving the transparent object through the opaque object. Press the 'r' or 'R' keys to reset the scene. A prototype is alpha3D.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 12, 2020, 11:52:16 PM
This program draws a texture mapped teapot with automatically generated texture coordinates. The texture is rendered as stripes on the teapot. Initially, the object is drawn with texture coordinates based upon the object coordinates of the vertex and distance from the plane x=0. Pressing the 'e' or 'E' keys changes the coordinate generation to eye coordinates of the vertex. Pressing the 'o' or 'O' keys switches it back to the object coordinates. Pressing the 's' or 'S' keys changes the plane to a slanted one (x+y+z=0). Pressing the 'x' or 'X' keys switches it back to x=0. A prototype is texgen.c  from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 12, 2020, 11:54:16 PM
China shop window (https://wasm.in/styles/smiles_s/mosking.gif)
This program demonstrates lots of material properties. A single light source illuminates the objects. A prototype is teapots.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 13, 2020, 11:54:07 AM
The teapot again
Converted example from the tutorial Igor Tarasov "OpenGL Fundamentals" common.c There are asm-file, raw-file for texture, cursor and exe-file in the attachment
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 14, 2020, 02:39:05 AM
Converted example from the tutorial Igor Tarasov "OpenGL Fundamentals" control.c There are asm-file, cursor and exe-file in the attachment
Interaction: pressing the "Arrow Left", "Arrow Right", "Arrow Up" and "Arrow Down"
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 15, 2020, 10:56:18 AM
Hi, All!
I'm interested in
Title: Re: OpenGL in masm64
Post by: Siekmanski on June 15, 2020, 12:09:52 PM
I have tested most of them, and they work perfect.  :cool:
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 15, 2020, 03:50:34 PM
Hallo, Siekmanski!
Bedankt u! (https://wasm.in/styles/smiles_s/thank_you2.gif)
Title: Re: OpenGL in masm64
Post by: Siekmanski on June 15, 2020, 09:50:50 PM
Graag gedaan.  :thumbsup:
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 15, 2020, 11:17:06 PM
Tsaar Peter de Grote bracht Nederlandse woorden naar mijn land
Title: Re: OpenGL in masm64
Post by: Siekmanski on June 16, 2020, 01:36:22 AM
He loved the ships we build and the infrastructure of our country. ( channels and roads )
And the lovely, blond and handsome tall women.  :biggrin:
Do you have some examples of those Dutch words?
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 16, 2020, 03:21:41 AM
мичман, абрикос, ватерлиния, зюйд, крейсер, ост, флагшток, аврал, ватерпас, кабель, крен, пеленг, флот, адмирал, веер, кабельтов, кубрик, рея, флюгер, апельсин, верфь, камбуз, лавировать, риф, швартов, байка, вест, каюта, лакмус, рубка, шкипер, бакен, вымпел, киль, ливер, руль, шкот, балласт, гавань, кильватер, лиф, рупор, шлюз, банка, газ, кливер, лоцман, сельдерей, шлюпка, баркас, гальюн, клипер, люк, стапель, шпиль, биржа, гарпун, кноп, мат, строп, штиль, бот, грот, койка, матрас, такелаж, штопор, боцман, дамба, кок, матрос, трап, альпеншток, шторм, брандспойт, док, конфорка, мачта, трос, штурвал, брезент, домкрат, кофе, мопс, доктор, трюм, штурман, брюки, киль, драить, компас, краб, мортира, фарватер, шхуна, буй, дюйм, краги, норд, флаг, ювелир, ванта, вантуз, вахта, зонтик, кран, обшлаг, флагман, яхта, суп, инфантерия, кавалерия, артиллерия, бомба, граната, леер, вентилятор, сироп, ватман, кульман, характер...
Deze woorden verschenen in het Russisch onder Peter de Grote. Dit zijn woorden uit het oude Nederlands, je bent een beetje veranderd, maar we hebben het nog steeds. Russische vlag is een gewijzigde vlag van Holland. De rode balk is van boven naar beneden verschoven
Title: Re: OpenGL in masm64
Post by: Siekmanski on June 16, 2020, 07:43:39 AM
Many of the words come from seafaring, cool.
Didn't know we had so many words in common.
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 16, 2020, 09:48:23 PM
Next two examples remind Jules Verne books. (https://wasm.in/styles/smiles_s/mosking.gif)

Twenty Thousand Leagues Under the Seas. Finding captain Nemo
Converted example "Surface by HackMaster" from http://shackmaster.narod.ru/ The surface is programm generated. The texture from the file "texture.bmp" is superimposed on the surface. There are asm-file, bmp-file for texture, cursor and exe-file in the attachment
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 17, 2020, 12:20:09 PM
Around the World in the Aerostat
Converted example "Sierra by HackMaster" from http://shackmaster.narod.ru/ The surface is obtained when processing file "map.bmp". The texture from the file "texture.bmp" is superimposed on the surface. The aerostat moves forward in a sine wave. There are asm-file, bmp-files, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 19, 2020, 02:18:46 AM
Now is not up to OpenGL. Write your comments and suggestions (https://wasm.in/styles/smiles_s/yes3.gif)
Title: Re: OpenGL in masm64
Post by: jj2007 on June 19, 2020, 05:43:23 AM
Quote from: Mikl__ on June 19, 2020, 02:18:46 AM
I am interrupting for now. I'm not up to OpenGL now. Write about your comments and suggestions. (https://wasm.in/styles/smiles_s/yes3.gif)

Thank you for giving us some time to breathe and digest your code :tongue:

Compliments, Mikl - your work is fantastic :thumbsup:
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 23, 2020, 10:20:55 PM
Have you relaxed and rested enough? (https://wasm.in/styles/smiles_s/smoke.gif)


Antarctica
Converted example from https://nehe.gamedev.net/tutorial/beautiful_landscapes_by_means_of_height_mapping/16006/ There are asm-file, raw-file, cursor and exe-file in the attachment.
Interaction:
January 28, 1820 is the day of the discovery of the sixth continent ― Antarctica. The honor to open the sixth continent fell to the Russian sailors: Thaddeus F. Bellingshausen (1778-1852) and Mikhail P. Lazarev (1788-1851).
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 27, 2020, 02:10:51 PM
[delete]
Title: Re: OpenGL in masm64
Post by: jj2007 on June 27, 2020, 07:21:41 PM
Hey, Mikl, this is impressive :thumbsup:

But I was convinced that it showed dark clouds over Antarctica - and that seems entirely plausible to me. Even Greta wouldn't mind, I guess :cool:

Btw it shows a weird behaviour on my Win7-64 machine: sometimes it works, sometimes it just shows me a black screen :rolleyes:
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 27, 2020, 07:48:49 PM
QuoteBtw it shows a weird behaviour on my Win7-64 machine: sometimes it works, sometimes it just shows me a black screen
Ciao, jj2007!
I'm very interested in the stable work of my programs, but this is impossible if there is no feedback between me and the user
Title: Re: OpenGL in masm64
Post by: Siekmanski on June 27, 2020, 09:36:22 PM
Works perfect on my PC, very smooth color transition.  :thumbsup:
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 27, 2020, 10:52:07 PM
Hallo, Siekmanski!
Dank je voor het antwoord!
Title: Re: OpenGL in masm64
Post by: Mikl__ on June 28, 2020, 06:07:58 PM
QuoteDen Brer Rabbit talk mighty 'umble.
"I don't keer w'at you do wid me, Brer Fox," sezee, "so you don't fling me in dat brier-patch. Roas' me, Brer Fox" sezee, "but don't fling me in dat brierpatch," sezee.
The prototype is "Display JPG" by Franck Charlet. There are asm-file, jpg-file, cursor and exe-file in the attachment. The main thing to remember is that the width equal to the height of the image in the jpg file, must be a power of two.
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 05, 2020, 05:32:22 PM
Converted example from https://nehe.gamedev.net/tutorial/radial_blur__rendering_to_a_texture/18004/ There are asm-file, cursor and exe-file in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 11, 2020, 12:34:40 PM
The gift for Stive Hutchinson to 72-nd birthday (better late than never)
Converted example from https://nehe.gamedev.net/tutorial/flag_effect_(waving_texture)/16002/ There are asm/bmp/exe-files and cursor in the attachment.
P.S. Sorry, the bmp-file was missing in the attachment, I had to redo it
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 13, 2020, 12:45:39 PM
Converted example from https://nehe.gamedev.net/tutorial/moving_bitmaps_in_3d_space/17001/ There are asm-\bmp-\exe-files and  cursor in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 18, 2020, 11:29:31 AM
This program demonstrates drawing pixels and shows the effect of glDrawPixels(), glCopyPixels(), and glPixelZoom().
Interaction: A prototype is image.c from https://www.opengl.org/archives/resources/code/samples/redbook/ There are asm-\exe-files and cursor in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 19, 2020, 03:21:12 PM
A prototype is "Move Original" by Franck Charlet. There are asm-\exe-files and  cursor in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 19, 2020, 04:12:03 PM
A prototype is "Infinite Light" by Franck Charlet. There are asm-\exe-files and  cursor in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 19, 2020, 07:43:39 PM
A prototype is "Light and Colored Texture" by Franck Charlet. There are asm-\exe-\bmp-files and  cursor in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 20, 2020, 01:02:44 AM
A prototype is "Texture Matrix" by Franck Charlet. There are asm-\exe-\bmp-files and  cursor in the attachment.
Title: Re: OpenGL in masm64
Post by: jj2007 on July 20, 2020, 03:38:06 AM
Quote from: Mikl__ on July 20, 2020, 01:02:44 AM
A prototype is "Texture Matrix" by Franck Charlet
(http://masm32.com/board/index.php?action=dlattach;topic=8514.0;attach=10749)

This is old! (https://spaceship.fandom.com/wiki/Borg_Cube) Show me something new, Mikl :smiley:
(https://vignette.wikia.nocookie.net/spaceship/images/5/56/Borg_cube_basic.png/revision/latest/scale-to-width-down/340?cb=20120125015656)
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 21, 2020, 11:13:04 AM
Ciao! jj2007!
The Borg cube spaceship is not old. It is vintage.  The first television series, called "Star Trek" debuted in 1966. Steve Hutchinson was 18 when this series was begun.
Let's go back to today. A prototype is "Scissor" by Franck Charlet. There are asm\exe-files and cursor in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 21, 2020, 11:36:39 AM
A prototype is "Local Light" by Franck Charlet. There are asm\exe-files and  cursor in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 21, 2020, 02:19:42 PM
A prototype is "Specular Material" by Franck Charlet. There are asm\exe-files and cursor in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 21, 2020, 07:01:42 PM
A prototype is "Fog" by Franck Charlet. There are asm\exe-files and cursor in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 23, 2020, 11:02:14 AM
Especially for jj2007. The Armada of Borg cubes is moving to conquer the deepest space
Converted example from https://nehe.gamedev.net/tutorial/display_lists/15003/ There are asm\bmp\exe-files and cursor in the attachment.
Interaction: pressing the "Arrow Left", "Arrow Right", "Arrow Up" and "Arrow Down"
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 23, 2020, 11:04:17 AM
continuation
Title: Re: OpenGL in masm64
Post by: jj2007 on July 23, 2020, 06:31:46 PM
Quote from: Mikl__ on July 23, 2020, 11:02:14 AM
Especially for jj2007. The Armada of Borg cubes is moving to conquer the deepest space
Converted example from https://nehe.gamedev.net/tutorial/display_lists/15003/ There are asm\bmp\exe-files and cursor in the attachment.
Interaction: pressing the "Arrow Left", "Arrow Right", "Arrow Up" and "Arrow Down"

That's frightening, my friend :greenclp: :greenclp: :greenclp:
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 23, 2020, 08:19:10 PM
C'è niente di pauro, caro jj2007 (https://wasm.in/styles/smiles_s/mosking.gif) It is in the far-far away galaxy
Title: Re: OpenGL in masm64
Post by: TouEnMasm on July 23, 2020, 10:17:37 PM

miss just a ball to break this armada  :badgrin:
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 23, 2020, 11:05:37 PM
Yvette, tu aimes jouer au billard? (https://wasm.in/styles/smiles_s/good3.gif)
Title: Re: OpenGL in masm64
Post by: TouEnMasm on July 24, 2020, 07:38:55 AM

Les jeux de casse boits,c'est pas mal non plus :icon_idea: :biggrin:
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 26, 2020, 11:03:01 AM
Converted example from 'OpenGL tutorial' by Tyler Durden - Radial blur. There are asm\exe-files and cursor in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 27, 2020, 05:55:59 PM
A prototype is dof.c from https://www.opengl.org/archives/resources/code/samples/redbook/ This program demonstrates use of the accumulation buffer to create an out-of-focus depth-of-field effect. The teapots are drawn several times into the accumulation buffer. The viewing volume is jittered, except at the focal point, where the viewing volume is at the same position, each time. In this case, the gold teapot remains in focus. There are asm\exe-files and cursor in the attachment.
Title: Re: OpenGL in masm64
Post by: jj2007 on July 27, 2020, 06:52:15 PM
Dear Mikl,
I see only a black window - is that intentional?
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 27, 2020, 06:57:38 PM
Hi, jj2007!
I seem to have done everything right, but for some reason the brightness is low. nidud had Same result in http://masm32.com/board/index.php?topic=7599.0 Try to increase the brightness and see 5 teapots. I will probably have to redo the program
Title: Re: OpenGL in masm64
Post by: jj2007 on July 27, 2020, 08:03:48 PM
Better? ;-)
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 27, 2020, 08:06:42 PM
Of course better! jj2007, what did you fix? There is a picture on the site https://www.opengl.org/archives/resources/code/samples/redbook/
(https://www.opengl.org/archives/resources/code/samples/redbook/dof.jpg)
I think I understand it. jj2007, did you just turn up the brightness on the screen? (https://wasm.in/styles/smiles_s/acute.gif)
Title: Re: OpenGL in masm64
Post by: jj2007 on July 27, 2020, 11:00:55 PM
I threw it into my trusty old PaintShop 4.1, used a Gamma correction of 1.6 and increased brightness a little bit :tongue:
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 28, 2020, 02:00:32 PM
Especially for jj2007. Second try. Let's find differences from the first version program (https://wasm.in/styles/smiles_s/mosking.gif) Feedback is needed to make programs better
Title: Re: OpenGL in masm64
Post by: jj2007 on July 28, 2020, 05:44:33 PM
That looks perfect, my friend :thumbsup:
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 28, 2020, 06:13:57 PM
Ciao, jj2007!
Ho fatto del mio meglio. . .(https://wasm.in/styles/smiles_s/blush2.gif)
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 28, 2020, 09:36:07 PM
Rotating model of "the 3-rd planet from the Sun".
Interaction:
There are asm\exe\raw-files and cursor in the attachment --> 77.zip (https://wasm.in/attachments/77-zip.6279/) (1994 Kb)
Title: Re: OpenGL in masm64
Post by: Mikl__ on July 31, 2020, 02:03:29 AM
The Rotating Donut in syrup
A prototype is "OpenGL torus in Assembly" by Sergey Chaban. There are asm\exe-files and cursor in the attachment.
Title: Re: OpenGL in masm64
Post by: Mikl__ on August 01, 2020, 01:04:48 PM
NeHe's tutorial 15 : Texture mapping outline fonts
There are asm\bmp\exe-files and cursor in the attachment.
Title: Re: OpenGL in masm64
Post by: avcaballero on August 01, 2020, 06:01:43 PM
You're a tireless programmer, Mikl  :thumbsup:
Title: Re: OpenGL in masm64
Post by: Mikl__ on August 01, 2020, 07:03:21 PM
¡Hola Alfonso!
Mis vacaciones se terminaron en la universidad, las conferencias para los estudiantes están comenzando y no tendré tiempo para OpenGL (https://wasm.in/styles/smiles_s/don-t_mention.gif)
Title: Re: OpenGL in masm64
Post by: HSE on May 20, 2021, 05:01:42 AM
Hi Mikl__!

After a while finally I can build something (first example, don't expect a lot  :biggrin:).

No AVX here, then movq don't work.
Some modifications are needed in opengl.inc:movf8 macro x,y
      ifndef movf8store
        .data
           movf8store qword 0
        .code
      endif
      db 48h,0B8h
      dq y
      mov movf8store, rax
      movsd x, movf8store
      ;%movq &x,rax
endm

movf8r macro x,y  ; this replace movq xmm, reg
      ifndef movf8store
        .data
           movf8store qword 0
        .code
      endif
      mov movf8store, y
      movsd x, movf8store
endm


Regards, HSE.