Created
May 6, 2020 04:35
-
-
Save doremi31618/22387af97970d958830cfc491024920b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.cpp | |
// OpenGL_ViewFrustumAdjustment | |
// | |
// Created by 詹閔翔 on 2020/5/5. | |
// Copyright © 2020 詹閔翔. All rights reserved. | |
// | |
#include <iostream> | |
#include <GLUT/glut.h> | |
#define WINDOW_WIDTH 250 | |
#define WINDOW_HEIGHT 250 | |
void display(void); | |
void init(void); | |
int main(int argc, char * argv[]) { | |
//init the glut | |
glutInit(&argc, argv); | |
//setting display mode | |
glutInitDisplayMode(GLUT_DEPTH | GLUT_SINGLE | GLUT_RGB); | |
//setting the window size | |
glutInitWindowSize(WINDOW_WIDTH, WINDOW_HEIGHT); | |
//set the window position | |
glutInitWindowPosition(100,100); | |
//create the window | |
glutCreateWindow("First window"); | |
//call init | |
init(); | |
//call display function | |
glutDisplayFunc(display); | |
//Enter the GLUT event loop | |
glutMainLoop(); | |
return 0; | |
} | |
//like processing setting | |
void init(){ | |
//setting background color | |
glClearColor(0, 0, 0, 0); | |
} | |
//like processing draw | |
void display(){ | |
//background color(0,0,0,0); | |
glClearColor(0, 0, 0, 0); | |
glFlush(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment