flat assembler
Message board for the users of flat assembler.

Index > Windows > Stupid stuff with glRasterPos2f (OpenGL)

Author
Thread Post new topic Reply to topic
Tyler Durden



Joined: 24 Feb 2004
Posts: 50
Tyler Durden
I wrote a simple code, but whatta f*** ?! Why text is in the center (by X coordinate) of the screen ?!?!?!
Code:
format PE GUI 4.0
entry start
include '%fasminc%\win32a.inc'
include 'opengl_const.inc'
include 'opengl_macros.inc'
start:
xor ebx,ebx
invoke ShowCursor,ebx
push ebx
push ebx
push ebx
push ebx
invoke GetSystemMetrics,SM_CYSCREEN
push eax
invoke GetSystemMetrics,ebx
push eax
fild dword [esp]
fdiv dword [esp+4]
fstp [ratio]
invoke CreateWindowEx,WS_EX_TOPMOST,szClass,ebx,WS_VISIBLE+WS_POPUP,ebx,ebx
invoke GetDC,eax
xchg ebp,eax
mov [pfd.dwFlags],PFD_DRAW_TO_WINDOW+PFD_SUPPORT_OPENGL+PFD_DOUBLEBUFFER
mov [pfd.iPixelType],PFD_TYPE_RGBA
mov [pfd.cColorBits],32
mov [pfd.dwLayerMask],PFD_MAIN_PLANE
invoke ChoosePixelFormat,ebp,pfd
invoke SetPixelFormat,ebp,eax,pfd
invoke wglCreateContext,ebp
invoke wglMakeCurrent,ebp,eax
invoke glEnable,GL_DEPTH_TEST
invoke CreateFont,-12,ebx,ebx,ebx,FW_BOLD,ebx,ebx,ebx,ebx,ebx,ebx,ebx,ebx,fon tName
invoke SelectObject,ebp,eax
invoke wglUseFontBitmapsW,ebp,0,256,ebx
invoke glHint,GL_PERSPECTIVE_CORRECTION_HINT,GL_NICEST
invoke glMatrixMode,GL_PROJECTION
glcall gluPerspective,90.0,ratio,0.1,100.0
invoke glMatrixMode,GL_MODELVIEW
invoke glClear,GL_COLOR_BUFFER_BIT+GL_DEPTH_BUFFER_BIT
invoke glLoadIdentity
invoke glTranslatef,ebx,ebx,-3.0
invoke glRasterPos2f,-2.0,2.0
invoke glCallList,'a'
invoke SwapBuffers,ebp
.wait:
invoke GetAsyncKeyState,VK_ESCAPE
test eax,eax
jz .wait
invoke ExitProcess,ebx
fontName db 'courier new',0
szClass db 'edit',0
data import
include 'imports.inc'
end data
ratio dq ?
pfd PIXELFORMATDESCRIPTOR    


Description: OpenGL macros/includes
Download
Filename: opengl.zip
Filesize: 16.85 KB
Downloaded: 90 Time(s)


_________________
Image
Post 23 Oct 2004, 23:20
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Tyler Durden



Joined: 24 Feb 2004
Posts: 50
Tyler Durden
Forget about Wink I've solve it... New OpenGL 1K FASM intro is on it's way Wink

_________________
Image
Post 27 Oct 2004, 12:38
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.