OpenGL 2D Game Engine
Install GCC Install freeglut in your GCC_PATH
Compile your project with
g++ -c -o main.o PROJECT_ENTRY_FILE.cpp -I"GCC_PATH"
g++ -o main.exe main.o -L"GCC_PATH\freeglut\lib\x64" -lfreeglut -lopengl32 -lglu32 -Wl,--subsystem,windows
Install HomeBrew
brew install gcc
brew cask install xquartz
brew install freeglut
Compile your project with
g++ -c -o main.o PROJECT_ENTRY_FILE.cpp
g++ -o main main.o -framework OpenGL -framework GLUT
List of all available methods for all classes
The object on the screen.
Renders an Entity inside of a Renderer class
Stores Entities and renders them each frame.
List of args in order:
- int x - Plain x coordinate of an Entity
- int y - Plain y coordinate of an Entity
- int w - Width of an Entity
- int h - Height of an Entity
- int angle - Rotation angle in degrees of an Entity
- float r - Red level of Entity's color (0-1)
- float g - Green level of Entity's color (0-1)
- float b - Blue level of Entity's color (0-1)
- int index - Entity index. By calling Renderer.sortEntities Entities are getting sorted so they are rendered in needed order.
Sorts Entities by their index in ascending order
Renders all stored Entities calling render method on them
Runs main OpenGL loop. Required to initialize rendering.