News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

OpenGL load function

Started by Farabi, August 20, 2005, 10:56:16 AM

Previous topic - Next topic

Farabi

I dont know is it work or not since now Im not at home but at another city.


CreateObjectByPolygon proc uses esi edi lppoly:dword,nCount:dword
LOCAL lptess,tmp_ecx,tmp_edx,rv:dword

cmp lppoly,0
jnz @f
ret
@@:
cmp nCount,0
jnz @f
ret
@@:

        invoke glGenLists,1
        mov rv,eax

invoke glNewList,rv,GL_COMPILE
invoke glShadeModel,GL_SMOOTH
invoke glBegin,GL_QUAD_STRIP


mov ecx,nCount
mov esi,lppoly
xor edx,edx
@@:
mov tmp_ecx,ecx
mov tmp_edx,edx
invoke glVertex3f,[esi+edx],[esi+edx+4],[esi+edx+8]
mov edx,tmp_edx
mov ecx,tmp_ecx
add edx,12
dec ecx
jnz @b

invoke glEnd
invoke glEndList




ret
CreateObjectByPolygon endp


Im sure this is right but still, I haven't test it. Im just type what is on my mind.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

hitchhikr

This should work.

Just be careful with GL_QUAD_STRIP,
if the datas contains vertices grouped by 4 entries (complete squares) you must use GL_QUADS instead.

Farabi

Quote from: hitchhikr on August 20, 2005, 04:14:17 PM
This should work.

Just be careful with GL_QUAD_STRIP,
if the datas contains vertices grouped by 4 entries (complete squares) you must use GL_QUADS instead.

I made a test for a template from your code.

[attachment deleted by admin]
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

Farabi

Add some fix. I will add the camera rotation and text object

[attachment deleted by admin]
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"