It is recommend reviewing the functions provided from WOGL. There are about 10 functions. Library documentationBasic program #include <stdio.h> #include <stdlib.h> #include "wogl.h" // when a key is pressed void mykeypressedfunc(int key) { if (key == WOGL_KEY_ESCAPE) { // exit nicely exit(0); } } void displayfunc() { // display nothing, print something printf("display function called\n"); } int main(int argc, char *argv[]) { int err;
// initialise wogl err = wogl_init(400, 400); if (err != WOGL_SUCCESS) { printf("WOGL init failed\n"); return -1; }
// tell wogl which functions to call wogl_set_keyboard_callback(mykeypressedfunc); wogl_set_display_callback(displayfunc);
// begin the event loop err = wogl_start_rendering(); if (err != WOGL_SUCCESS) { printf("WOGL start render failed\n"); return -2; }
return 0; } Linking to WOGL library with Microsoft Visual StudioYou can use the visual studio template solution that includes:
1) Add the wogl.h source file to the project. ![]() 2) Right click on the project name and select Properties |