News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Invoke vs Call with jwasm

Started by xtracer, July 12, 2011, 10:10:43 PM

Previous topic - Next topic

xtracer

Hi!

i want to use invoke instead of call in my subroutine using opengl arb,by using invoke i must use the proto for the arb call but then i get an error with the declaration in the data section.
someone now of a workaround for this problem ?

normal call:
Invoke   wglGetProcAddress,Offset aglBufferSubDataARB
Mov   glBufferSubDataARB,EAX
...........

Push   Cube_Vertex_Memory_Block
Push   Cube_Vertex_Mem_Item_Size
Push   Cube_Vertex__Vbo_Mem_Pointer
Push   GL_ARRAY_BUFFER_ARB
Call   glBufferSubDataARB
Data:
aglBufferSubDataARB      DB   "glBufferSubDataARB",0
glBufferSubDataARB      DD   0

invoke:

Invoke   wglGetProcAddress,Offset aglBufferSubDataARB
Mov   glBufferSubDataARB,EAX

........

Invoke   glBufferSubDataARB,GL_ARRAY_BUFFER_ARB,Cube_Vertex__Vbo_Mem_Pointer.Cube_Vertex_Mem_Item_Size,Cube_Vertex_Memory_Block

Data:
aglBufferSubDataARB      DB   "glBufferSubDataARB",0
glBufferSubDataARB      DD   0   (this is the problem when i use the prototype)


i get this error :Error A2148: Too few arguments to INVOKE: glBufferSubDataARB
oh and i use jwasm :bg

xtracer


Oh I forgot one thing I do not have opengl 1.5
I can not use glBufferSubData since it is not a core function.

qWord

by goggling I've found this:
void glBufferSubDataARB(GLenum target, GLint offset, GLsizei size, void* data)
so, you need at least 4 parameters - that's also what the error message says ;-)

Also: such post should be placed in the OpenGL forum or at the campus!
FPU in a trice: SmplMath
It's that simple!

xtracer

sorry for the typo,it is 4 parameters

Invoke   glBufferSubDataARB,GL_ARRAY_BUFFER_ARB,Cube_Vertex__Vbo_Mem_Pointer,Cube_Vertex_Mem_Item_Size,Cube_Vertex_Memory_Block

it isn't only an opengl issue,u get it when u use wglGetProcAddress.

drizz

Plenty of info to be found using the forum search.
http://www.masm32.com/board/index.php?topic=11110.msg82041#msg82041
http://www.masm32.com/board/index.php?topic=5299.msg39702#msg39702
http://www.masm32.com/board/index.php?topic=5302.msg39704#msg39704
http://www.masm32.com/board/index.php?topic=8134.msg59391#msg59391

;; void glBufferSubDataARB(GLenum target, GLint offset, GLsizei size, void* data)
proto_glBufferSubDataARB proto stdcall target:GLenum, offset_:GLint, size_:GLsizei, data:PVOID
ptr_glBufferSubDataARB typedef ptr proto_glBufferSubDataARB

.data?
glBufferSubDataARB ptr_glBufferSubDataARB ?

.code

Invoke wglGetProcAddress,Offset aglBufferSubDataARB
Mov glBufferSubDataARB,EAX



Invoke glBufferSubDataARB,...


The truth cannot be learned ... it can only be recognized.