Anyone can notice what Im doing wrong when trying to use Vertex Buffer Object ??
Quote
invoke wglGetProcAddress,CADD("glGenBuffersARB")
.if eax==0
dec eax
mov vbo_status,eax
jmp no_vbo
.else
mov glGenBuffersARB,eax
invoke wglGetProcAddress,CADD("glBindBufferARB")
mov glBindBufferARB,eax
invoke wglGetProcAddress,CADD("glBufferDataARB")
mov glBufferDataARB,eax
invoke wglGetProcAddress,CADD("glDeleteBuffersARB")
mov glDeleteBuffersARB,eax
mov edx,glGenBuffersARB
and edx,glBindBufferARB
and edx,glBufferDataARB
and edx,glDeleteBuffersARB
.if edx==0
invoke MessageBox,0,CADD("One or more function is not exist, VBO Failed"),0,0
xor eax,eax
dec eax
mov vbo_status,eax
jmp no_vbo
.endif
fglBindBufferARB proc nTarget:dword,nbuffer:dword
push nbuffer
push nTarget
call glBindBufferARB
add esp,2*4
ret
fglBindBufferARB endp
fglDeleteBuffersARB proc nTarget:dword,lpbuffer:dword
push lpbuffer
push nTarget
call glDeleteBuffersARB
add esp,2*4
ret
fglDeleteBuffersARB endp
fglGenBuffersARB proc nSize:dword,lpbuffer:dword
push lpbuffer
push nSize
call glGenBuffersARB
add esp,2*4
ret
fglGenBuffersARB endp
fglBufferDataARB proc nTarget:dword,nSizei:dword,lpData:dword,nEnumUsage:dword
push nEnumUsage
push lpData
push nSizei
push nTarget
call glBufferDataARB
add esp,4*4
ret
fglBufferDataARB endp
Thanks for your time.
Use a correct error detection.
Quote from: qWord on July 04, 2012, 07:36:58 PM
Use a correct error detection.
That doesnot help :P
Anyway I found where is my mistake.
So, what was the mistake that couldn't be detected by proper error handling?
;)
Quote from: qWord on July 04, 2012, 10:10:12 PM
So, what was the mistake that couldn't be detected by proper error handling?
;)
I should point the buffer to a zero ID. Because the ID pointing to the GPU Memory.
I dont think there would be any error handling for such a thing.