Code Monkey home page Code Monkey logo

opengl-es-2.0-cpp's Introduction

OpenGL-ES-2.0-cpp


Introduction

This is a graphics application based on OpenGL ES 2.0 API, using C++ and the OpenGL ES Shading Language. The logic structure of this project is like the cocos2d-x game engine, it is started by main.cpp which contains main() function and calls Appdelegate's run() function.

Main contents in this project are:

Draw Rectangle, Circle, etc , simple graphics.

these simple graphics drawwing programs help understanding the process of a OpenGL ES program running.

Texture

  • basic texture rendering

  • multiple texture rendering

dog_texture.gif

Mipmapping

mipmap_effect.gif

3D projection

comprehensive_test.gif

Using of buffer objects: VAO, VBO

vbo_cube.gif

Alpha test, depth test

[ ] Critical Codes

namespace elloop { 

class Application;      // application abstraction.

class AppDelegate;      // derived from Application.

class OpenGLView;       // Windows control and OpenGL ES Drawing Context.

class Director;         // control the process of rendering.

class Drawable;         // things to be rendered.

class Ref;              // Object, for reference counting.

class AutoReleasePool;  // manage the reference count of pointer to object of type Ref.

class PoolManager;      // manage AutoReleasePool stack.

// ShaderHelper: help class for compiling and linking shader programs
class ShaderHelper {
public:
    static const ShaderId compileVertexShader(const std::string &shaderSrc);
    static const ShaderId compileFragmentShader(const std::string &shaderSrc);
    static ProgramId linkProgram(ShaderId vertexShaderId, ShaderId fragShaderId);
private:
    static ShaderId compileShader(const std::string &shaderSrc, GLenum shaderType);
};

}

License

This project is licensed under the MIT License.

Blogs about this project

=============================

中文文档

这个项目是一个基于OpenGL ES 2.0 API的图形演示程序,编程语言是C++和The OpenGL ES Shading Language. 工程的逻辑架构是模仿cocos2d-x来组织的,main函数在main.cpp里面,其中启动Appdelegate来完成程序的启动。

主要包含的内容有:

绘制矩形,圆等简单图形

绘制纹理

Mipmapping

3D投影

使用缓冲对象:VAO,VBO

Alpha测试 深度测试

关于此项目的一些博客

[ ] 关键代码解释

namespace elloop { 

class Application;      // application abstraction.

class AppDelegate;      // derived from Application.

class OpenGLView;       // Windows control and OpenGL ES Drawing Context.

class Director;         // control the process of rendering.

class Drawable;         // things to be rendered.

class Ref;              // Object, for reference counting.

class AutoReleasePool;  // manage the reference count of pointer to object of type Ref.

class PoolManager;      // manage AutoReleasePool stack.

// ShaderHelper: help class for compiling and linking shader programs
class ShaderHelper {
public:
    static const ShaderId compileVertexShader(const std::string &shaderSrc);
    static const ShaderId compileFragmentShader(const std::string &shaderSrc);
    static ProgramId linkProgram(ShaderId vertexShaderId, ShaderId fragShaderId);
private:
    static ShaderId compileShader(const std::string &shaderSrc, GLenum shaderType);
};

}

许可协议

MIT License

opengl-es-2.0-cpp's People

Contributors

elloop avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.