1
0
kolibrios/programs/develop/libraries/TinyGL/asm_fork/clear.asm
IgorA 11b3a68203 fix in glClearColor
git-svn-id: svn://kolibrios.org@5163 a494cfbc-eb01-0410-851d-a64ba20cac60
2014-11-03 15:53:21 +00:00

53 lines
1.1 KiB
NASM

align 4
proc glopClearColor uses ecx esi edi, context:dword, p:dword
mov esi,[p]
add esi,4
mov edi,[context]
add edi,offs_cont_clear_color
mov ecx,4
rep movsd
ret
endp
align 4
proc glopClearDepth uses eax ebx, context:dword, p:dword
mov eax,[context]
mov ebx,[p]
mov ebx,[ebx+4] ;ebx = p[1]
mov dword[eax+offs_cont_clear_depth],ebx
ret
endp
align 4
fl_65535 dd 65535.0
align 4
proc glopClear uses eax ebx, context:dword, p:dword
mov eax,[context]
fld dword[eax+offs_cont_clear_color+8] ;context.clear_color.v[2]
fmul dword[fl_65535]
fistp dword[esp-4]
fld dword[eax+offs_cont_clear_color+4] ;context.clear_color.v[1]
fmul dword[fl_65535]
fistp dword[esp-8]
fld dword[eax+offs_cont_clear_color] ;context.clear_color.v[0]
fmul dword[fl_65535]
fistp dword[esp-12]
sub esp,12
mov ebx,[p]
mov ebx,[ebx+4] ;ebx = p[1]
and ebx,GL_COLOR_BUFFER_BIT
push ebx
mov ebx,[p]
mov ebx,[ebx+4] ;ebx = p[1]
and ebx,GL_DEPTH_BUFFER_BIT
; TODO : correct value of Z
stdcall ZB_clear,[eax+offs_cont_zb],ebx,0 ;,...,r,g,b
ret
endp