OpenGL-GLFW
view release on metacpan or search on metacpan
GLFWmonitor*
glfwGetPrimaryMonitor();
#// GLFWmonitor**
#// glfwGetMonitors(OUTLIST int count);
void
glfwGetMonitors();
PREINIT:
GLFWmonitor** monitors = NULL;
int n, count;
PPCODE:
monitors = glfwGetMonitors(&count);
printf("glfwGetMonitors() returns %d values\n",count);
for (n=0; n<count; n++)
XPUSHs(sv_2mortal(newRV_noinc(newSViv(PTR2IV(monitors+n)))));
const char*
glfwGetMonitorName(GLFWmonitor* monitor);
void
#// const GLFWvidmode*
void
glfwGetVideoModes(GLFWmonitor* monitor);
PREINIT:
HV * hash;
const GLFWvidmode* vidms = NULL;
int nmodes = -1;
int n;
PPCODE:
// get video modes
vidms = glfwGetVideoModes(monitor,&nmodes);
if (!vidms) croak("null pointer as GLFWvidmode-s");
if (nmodes <= 0) croak("no GLFWvidmode-s returned");
for (n=0; n<nmodes; n++) {
// pack vidmode into hash
hash = (HV*)sv_2mortal((SV*)newHV());
hv_store(hash, "width", 5, newSViv((vidms+n)->width), 0);
hv_store(hash, "height", 6, newSViv((vidms+n)->height), 0);
const char*
glfwGetVersionString();
#// const float*
#// glfwGetJoystickAxes(int joy, OUTLIST int count);
void
glfwGetJoystickAxes(int joy);
PREINIT:
const float* axes = NULL;
int n, count;
PPCODE:
axes = glfwGetJoystickAxes(joy,&count);
printf("glfwGetJoystickAxes() returns %d values\n",count);
for (n=0; n<count; n++)
XPUSHs(sv_2mortal(newSVnv(*(axes+n))));
#// const unsigned char*
#// glfwGetJoystickButtons(int joy, OUTLIST int count);
void
glfwGetJoystickButtons(int joy);
PREINIT:
const unsigned char* buttons = NULL;
int n, count;
PPCODE:
buttons = glfwGetJoystickButtons(joy,&count);
printf("glfwGetJoystickButtons() returns %d values\n",count);
for (n=0; n<count; n++)
XPUSHs(sv_2mortal(newSViv(*(buttons+n))));
int
glfwInit();
int
glfwJoystickPresent(int joy);
int
glfwGetPlatform();
#endif
void
glfwGetError();
PREINIT:
int errcode;
char* description;
PPCODE:
errcode = glfwGetError((const char**)&description);
EXTEND(SP, 2);
PUSHs(sv_2mortal(newSViv(errcode)));
PUSHs(!description ? &PL_sv_undef : sv_2mortal(newSVpv(description, 0)));
void
glfwInitHint(int hint, int value);
#//-------------------------------------------------------------------
#// OpenGL not supported (use GLEW)
( run in 0.599 second using v1.01-cache-2.11-cpan-5511b514fd6 )