Author Topic: [OpenGL] What Im doing wrong  (Read 2880 times)

Farabi

  • Member
  • ****
  • Posts: 970
  • Neuroscience Fans
[OpenGL] What Im doing wrong
« on: July 04, 2012, 12:50:57 PM »
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

  • Member
  • *****
  • Posts: 1473
  • The base type of a type is the type itself
    • SmplMath macros
Re: [OpenGL] What Im doing wrong
« Reply #1 on: July 04, 2012, 07:36:58 PM »
Use a correct error detection.
MREAL macros - when you need floating point arithmetic while assembling!

Farabi

  • Member
  • ****
  • Posts: 970
  • Neuroscience Fans
Re: [OpenGL] What Im doing wrong
« Reply #2 on: July 04, 2012, 08:48:42 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

  • Member
  • *****
  • Posts: 1473
  • The base type of a type is the type itself
    • SmplMath macros
Re: [OpenGL] What Im doing wrong
« Reply #3 on: July 04, 2012, 10:10:12 PM »
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

  • Member
  • ****
  • Posts: 970
  • Neuroscience Fans
Re: [OpenGL] What Im doing wrong
« Reply #4 on: July 06, 2012, 04:03:48 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