OpenGL Tutorial
https://www.opengl-tutorial.org/
https://github.com/opengl-tutorials/ogl
https://www.leapreal.com/categories/theory/
GLTF
- https://gltf-viewer-tutorial.gitlab.io/
- https://gitlab.com/gltf-viewer-tutorial/gltf-viewer/-/tree/tutorial-cheat-v1/src?ref_type=heads
Documentation
- https://docs.gl/
Text Rendering
- https://devcodef1.com/news/1170796/qt-opengl-text-rendering
WebGL
- https://webglfundamentals.org/webgl/lessons/zh_cn/webgl-fundamentals.html
Other OpenGL References
- https://github.com/topics/modern-opengl
- https://github.com/hotstreams/limitless-engine
- https://github.com/ABRG-Models/morphologica
- https://github.com/douysu/graphics-algorithm
- https://github.com/wlxklyh/SoftRenderer
- https://github.com/micro-gl/micro-gl
- https://github.com/patriciogonzalezvivo/ada
- https://github.com/a-e-k/canvas_ity
- https://github.com/OGRECave/ogre-next
- https://github.com/keith2018/SoftGLRender
- https://github.com/ssloy/tinyrenderer
- https://github.com/ssloy/tinyraytracer
- https://github.com/mosra/magnum
- https://github.com/GameFoundry/bsf
- https://solarianprogrammer.com/2013/05/22/opengl-101-matrices-projection-view-model/
- https://github.com/jehugaleahsa/mogl
- https://github.com/rougier/tiny-renderer
- https://github.com/bkaradzic/bgfx
- https://ogldev.org/www/tutorial29/tutorial29.html
- https://github.com/leaf3d/leaf3d
- https://github.com/vikasgola/EaseOpenGL
- https://micro-gl.github.io/docs/microgl/getting-started/features
- https://github.com/huxingyi/dust3d
- https://github.com/keith2018/SoftGLRender
- https://github.com/Gargaj/Foxotron
Examples
A simple example on GLFW and GLEW:
MyWidget* w = nullptr;
static void cursor_position_callback(GLFWwindow* window, double xpos, double ypos)
{
if (!w)
{
return;
}
//std::cout << "Cursor position: (" << xpos << ", " << ypos << ")\n";
w->cursor_position_callback(xpos, ypos);
}
void mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
{
if (!w)
{
return;
}
double xpos, ypos;
glfwGetCursorPos(window, &xpos, &ypos);
if (button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_PRESS)
{
w->mousePressEvent(xpos, ypos);
}
else if (button == GLFW_MOUSE_BUTTON_LEFT && action == GLFW_RELEASE)
{
w->mouseReleaseEvent(xpos, ypos);
}
}
int main(void)
{
// Initialize GLFW
glfwInit();
// Open a window and create its OpenGL context
window = glfwCreateWindow(1024, 768, "Tutorial 01", NULL, NULL);
glfwMakeContextCurrent(window);
// Initialize GLEW
glewExperimental = true; // Needed for core profile
glewInit();
// Ensure we can capture the escape key being pressed below
glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE);
glfwSetCursorPosCallback(window, cursor_position_callback);
glfwSetMouseButtonCallback(window, mouse_button_callback);
if (!w)
{
w = new MyWidget();
//w.resizeGL(800, 600);
}
// Background color
glClearColor(0.5f, 0.6f, 0.5f, 0.5f);
do
{
// Clear the screen
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
if (w)
{
w->paintGL();
}
// Swap buffers
glfwSwapBuffers(window);
glfwPollEvents();
} // Check if the ESC key was pressed or the window was closed
while ((glfwGetKey(window, GLFW_KEY_ESCAPE) != GLFW_PRESS) && glfwWindowShouldClose(window) == 0);
// Close OpenGL window and terminate GLFW
glfwTerminate();
return 0;
}