There’s a header file, esUtil.h, with a definition for a structure called ESContext, and one of its members is userData. userData is a pointer to void.
The body of a program using it is this, briefly:
#include "esUtil.h"
typedef struct {
GLuint programObject;
} UserData;
int DoSomething(ESContext *esContext) {
UserData *userData = esContext->userData;
...
}
int main(int argc, char *argv[]) {
ESContext esContext;
UserData userData;
esStart(&esContext);
esContext.userData = &userData;
...
if(!DoSomething(&esContext))
return 0;
...
}
I’m confused by what “*userData” is in the statement: UserData *userData = esContext->userData;
And if it is a pointer, how it came into being without being declared. Thanks for any explanations.
Yes, it is a pointer. The line
declares a variable called
userDatawith typeUserData *(a pointer toUserData) and initializes it with the valueesContext->userData.