Jump to content
  • Advertisement
Sign in to follow this  
zmg2b6

GLsync type

This topic is 3006 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is from the gl3.h header file, I'm trying to get this into some C# code but I'm not sure what the C# equivalent of the GLsync type would be?

I'm not exactly sure what the C++ typedef for the GLsync type is actually doing, if someone could explain?


#ifndef ARB_sync
typedef int64_t GLint64;
typedef uint64_t GLuint64;
typedef struct __GLsync *GLsync;
#endif

// GL_ARB_sync
GLAPI GLboolean APIENTRY glIsSync (GLsync sync);
GLAPI void APIENTRY glDeleteSync (GLsync sync);



Here is my equivalent delegate function in C#, right now I just have the GLsync type as a struct:


public delegate GLBoolean glIsSync(GLSync sync);

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by zmg2b6
I'm not exactly sure what the C++ typedef for the GLsync type is actually doing, if someone could explain?
It is declaring GLsync to be a pointer to a struct.

I don't know what the C# equivalent would be, but I imagine that passing it a struct rather than a pointer is not quite right.

Share this post


Link to post
Share on other sites
Ok great, I'll use the C# System.IntPtr type, and look in the docs for that extension to see what the struct layout is supposed to be.

I didn't realize you could define a struct like this and not define any fields for the struct? Is it done like this to be platform independant, so you're supposed to define the struct in your own implementation code?

Share this post


Link to post
Share on other sites
Quote:
Original post by zmg2b6
I didn't realize you could define a struct like this and not define any fields for the struct? Is it done like this to be platform independant, so you're supposed to define the struct in your own implementation code?
You shouldn't ever have to deal with the struct layout - OpenGL will hand you a pointer, and you just store the pointer and pass it back to OpenGL.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!