hello well i get a very weird error and cant fix it i know it has do to something with brackets )
-
#define R_GLDRAWELEMENTS 0x5ED02FD4
WINAPI _R_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
WINAPI (*R_glDrawElements)(GLenum , GLsizei , GLenum , const GLvoid *) = (void (__stdcall*) (unsigned int,int,unsigned int,void const *)) R_GLDRAWELEMENTS;
WINAPI _R_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
{_R_glDrawElements( mode, count, type, indices);
}
The 3 line of code gives a bad error error C2059: syntax error : '(' And i dont know what is wrong with it the brackets seems to be all in place....
-
#define R_GLDRAWELEMENTS 0x5ED02FD4
WINAPI _R_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
WINAPI (*R_glDrawElements)(GLenum , GLsizei , GLenum , const GLvoid *) = (void (__stdcall*) (unsigned int,int,unsigned int,void const *)) R_GLDRAWELEMENTS;
WINAPI _R_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
{_R_glDrawElements( mode, count, type, indices);
}
The 3 line of code gives a bad error error C2059: syntax error : '(' And i dont know what is wrong with it the brackets seems to be all in place....
I'm not 100% sure how you didn't get other compiler errors, to be honest. I get errors where you've used WINAPI, as that doesn't (on my Windows installation) specify a return type - I have
#define WINAPI __stdcall
- just a calling convention. Also - in the body of _R_glDrawElements, you call _R_glDrawElements recursively - that'll cause a stack overflow. Did you really mean R_glDrawElements?? Anyway - try this (modulo changing the body of _R_glDrawElements if I was correct above)#define R_GLDRAWELEMENTS 0x5ED02FD4
void WINAPI _R_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
void (WINAPI* R_glDrawElements)(GLenum , GLsizei , GLenum , const GLvoid *) = (void (__stdcall*) (unsigned int,int,unsigned int,void const *)) R_GLDRAWELEMENTS;
void WINAPI _R_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
{_R_glDrawElements( mode, count, type, indices);
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
-
#define R_GLDRAWELEMENTS 0x5ED02FD4
WINAPI _R_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
WINAPI (*R_glDrawElements)(GLenum , GLsizei , GLenum , const GLvoid *) = (void (__stdcall*) (unsigned int,int,unsigned int,void const *)) R_GLDRAWELEMENTS;
WINAPI _R_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
{_R_glDrawElements( mode, count, type, indices);
}
The 3 line of code gives a bad error error C2059: syntax error : '(' And i dont know what is wrong with it the brackets seems to be all in place....
In addition to Stuart's reply, it is recommended to type define function pointers. It makes the code all the more readable.
typedef void (WINAPI* PFN_GLDRAWELEMENTS)(GLenum , GLsizei , GLenum , const GLvoid *);
PFN_GLDRAWELEMENTS R_glDrawElements = (PFN_GLDRAWELEMENTS)R_GLDRAWELEMENTS;«_Superman_» I love work. It gives me something to do between weekends.
-
In addition to Stuart's reply, it is recommended to type define function pointers. It makes the code all the more readable.
typedef void (WINAPI* PFN_GLDRAWELEMENTS)(GLenum , GLsizei , GLenum , const GLvoid *);
PFN_GLDRAWELEMENTS R_glDrawElements = (PFN_GLDRAWELEMENTS)R_GLDRAWELEMENTS;«_Superman_» I love work. It gives me something to do between weekends.
I tryed your methods but it dosent work .... typedef VOID (WINAPI* R_glDrawElements_) (GLenum , GLsizei , GLenum , const GLvoid *); R_glDrawElements_ pR_glDrawElements = 0x5ED02FD4; And doing this i get error C:\Documents and Settings\ivor\Desktop\test5\Client.cpp(23) : error C2440: 'initializing' : cannot convert from 'const int' to 'void (__stdcall *)(unsigned int,int,unsigned int,const void *)'
-
I tryed your methods but it dosent work .... typedef VOID (WINAPI* R_glDrawElements_) (GLenum , GLsizei , GLenum , const GLvoid *); R_glDrawElements_ pR_glDrawElements = 0x5ED02FD4; And doing this i get error C:\Documents and Settings\ivor\Desktop\test5\Client.cpp(23) : error C2440: 'initializing' : cannot convert from 'const int' to 'void (__stdcall *)(unsigned int,int,unsigned int,const void *)'
nah1337 wrote:
R_glDrawElements_ pR_glDrawElements = 0x5ED02FD4;
You need the typecast here.
R_glDrawElements_ pR_glDrawElements = **(R_glDrawElements_)**0x5ED02FD4;
«_Superman_» I love work. It gives me something to do between weekends.
-
I tryed your methods but it dosent work .... typedef VOID (WINAPI* R_glDrawElements_) (GLenum , GLsizei , GLenum , const GLvoid *); R_glDrawElements_ pR_glDrawElements = 0x5ED02FD4; And doing this i get error C:\Documents and Settings\ivor\Desktop\test5\Client.cpp(23) : error C2440: 'initializing' : cannot convert from 'const int' to 'void (__stdcall *)(unsigned int,int,unsigned int,const void *)'
Hello again thnx for previous replay well i still struggling with it and now i dosent just understand why i get the error i dont change anything after typedef .... typedef VOID (WINAPI* R_glDrawElements_) (GLenum , GLsizei , GLenum , const GLvoid *); R_glDrawElements_ pR_glDrawElements = (R_glDrawElements_)0x5ED02FD4; VOID WINAPI R_glDrawElements_(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) { R_glDrawElements_( mode, count, type, indices); } C:\Documents and Settings\ivor\Desktop\test5\Client.cpp(56) : error C2377: 'R_glDrawElements_' : redefinition; typedef cannot be overloaded with any other symbol C:\Documents and Settings\ivor\Desktop\test5\Client.cpp(27) : see declaration of 'R_glDrawElements_'