News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

[OpenGL] What Im doing wrong

Started by Farabi, July 04, 2012, 12:50:57 PM

Previous topic - Next topic

Farabi

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.
http://farabidatacenter.url.ph/MySoftware/
My 3D Game Engine Demo.

Contact me at Whatsapp: 6283818314165

qWord

MREAL macros - when you need floating point arithmetic while assembling!

Farabi

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.
http://farabidatacenter.url.ph/MySoftware/
My 3D Game Engine Demo.

Contact me at Whatsapp: 6283818314165

qWord

So, what was the mistake that couldn't be detected by proper error handling?
;)
MREAL macros - when you need floating point arithmetic while assembling!

Farabi

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.
http://farabidatacenter.url.ph/MySoftware/
My 3D Game Engine Demo.

Contact me at Whatsapp: 6283818314165