项目作者: klukasiuk

项目描述 :
Simple Graphics Library
高级语言: C
项目地址: git://github.com/klukasiuk/SimpleGL.git
创建时间: 2015-07-18T00:10:50Z
项目社区:https://github.com/klukasiuk/SimpleGL

开源协议:

下载


SimpleGL

A simple graphics library which I created for educational purposes. I have used this library for learning people C++ programing in my science club at university.

It’s still using old OpenGL 2.1 but I am planning to move to modern OpenGL.

Based on : GLFW , FTGL , SOIL2

Usage

  • Open Visual Studio solution with two projects
  • First build SimpleGL project which creates static lib
  • Then build SimpleGL_Example
  • If everything succeds there should be lib and example exe files in build folder
  • Example application is simple jumping mario animation which you can control whith arrows
  • To use library link static lib to your project

Features

  • Window creation and handling
  • Easy primitives rendering
  • Font rendering
  • Single and Double buffered rendering
  • Images loading
  • Mouse and Keyboard handling
  • Screenshots

Code example

  1. #include "SimpleGL.h" // Include basic SimpleGL functionality
  2. int main()
  3. {
  4. initGL(800, 600); // Create 800x600 pixels window
  5. while(true)
  6. {
  7. setColor(255,0,0); // Set red color
  8. circle(400,300,50); // Draw circle in the middle of screen
  9. swap(); // Show circle on screen and clear buffer
  10. checkEvents(); // Check for user input
  11. }
  12. return 0;
  13. }

Example application

Example application involves jumping mario animation. Mario can be controlled with arrows, mouse buttons rotate camera.
All code used for this example is just 200 lines

Screenshot of example program

Screenshot