int main(int argc, char* argv[]) { glusInitFunc(init); glusReshapeFunc(reshape); glusKeyFunc(key); glusUpdateFunc(update); glusTerminateFunc(terminate); glusPrepareContext(4, 2, GLUS_FORWARD_COMPATIBLE_BIT); // Create the output window. if (!glusCreateWindow("GLUS Example Window", 640, 480, 24, 0, GLUS_FALSE)) { printf("Could not create window!\n"); return -1; } // Print out the keys printf("Keys:\n"); printf("[Space] = Toggle view\n"); printf("a = Toggle animation on/off\n"); printf("w = Toggle wireframe on/off\n"); // Enter and run the main loop. glusRun(); return 0; }
int main(int argc, char* argv[]) { glusInitFunc(init); glusReshapeFunc(reshape); glusKeyFunc(key); glusUpdateFunc(update); glusTerminateFunc(terminate); glusPrepareContext(4, 1, GLUS_FORWARD_COMPATIBLE_BIT); // No resizing for convenience. If resizing is allowed, dynamically resize the SSAO and Blur frame buffer as well. glusPrepareNoResize(GLUS_TRUE); if (!glusCreateWindow("GLUS Example Window", TEXTURE_WIDTH, TEXTURE_HEIGHT, 24, 0, GLUS_FALSE)) { printf("Could not create window!\n"); return -1; } // Print out the keys printf("Keys:\n"); printf("s = Toggle SSAO on/off\n"); glusRun(); return 0; }
int main(int argc, char* argv[]) { glusInitFunc(init); glusReshapeFunc(reshape); glusKeyFunc(key); glusUpdateFunc(update); glusTerminateFunc(terminate); glusPrepareContext(4, 1, GLUS_FORWARD_COMPATIBLE_BIT); // No resize, as it makes code simpler. glusPrepareNoResize(GLUS_TRUE); // No MSAA here, as we render to an off screen MSAA buffer. if (!glusCreateWindow("GLUS Example Window", SCREEN_WIDTH, SCREEN_HEIGHT, 24, 0, GLUS_FALSE)) { printf("Could not create window!\n"); return -1; } // Print out the keys printf("Keys:\n"); printf("1 = Decrease roughness\n"); printf("2 = Increase roughness\n"); printf("3 = Decrease R0\n"); printf("4 = Increase R0\n"); printf("5 = Decrease Red\n"); printf("6 = Increase Red\n"); printf("7 = Decrease Green\n"); printf("8 = Increase Green\n"); printf("9 = Decrease Blue\n"); printf("0 = Increase Blue\n"); printf("\n"); glusRun(); return 0; }
/** * Main entry point. */ int main(int argc, char* argv[]) { glusInitFunc(init); glusReshapeFunc(reshape); glusUpdateFunc(update); glusTerminateFunc(shutdown); glusMouseFunc(mouse); glusMouseMoveFunc(mouseMove); glusKeyFunc(keyboard); glusPrepareContext(3, 0, GLUS_FORWARD_COMPATIBLE_BIT); if (!glusCreateWindow("C++, GLSL Ray Marching sample", 640, 480, GLUS_FALSE)) { printf("Could not create window!"); return -1; } // Init GLEW glewExperimental = GL_TRUE; GLenum err=glewInit(); if(err!=GLEW_OK) { sprintf("glewInitError", "Error: %s\n", glewGetErrorString(err)); return -1; } glGetError(); // flush error state variable, caused by glew errors // Only continue, if OpenGL 3.3 is supported. if (!glewIsSupported("GL_VERSION_3_0")) { printf("OpenGL 3.0 not supported."); glusDestroyWindow(); return -1; } glusRun(); return 0; }