Learning Modern OpenGL with C++ (in Computer Graphics)-Part 1

Learning Modern OpenGL with C++ (in Computer Graphics)-Part 1

INTRODUCTION

What is Computer Graphics?

  • Branch of Computer Science.
  • Computer + Graphs + Pics = Computer Graphics.
  • Drawing line, Chart, Graphs etc. on the screen using Programming language is computer Graphics.
Book Definition
  • Computer graphics is the branch of computer science that deals with generating images with the aid of computers. It displays the information in the from of graphics objects such as picture, charts, graphs and diagrams instead of simple text. We can say computer graphics makes it possible to express data in pictorial form.
OpenGL
  • It is cross-platform, cross-language API for rendering 2D and 3D Graphics(Vector Graphics).

Code with C++

Introduction to GLEW and GLFW Libraries
  • What is GLEW?
    • The OpenGL Extension Wrangler Library.
    • Cross-platform open-source C/C++ extension loading library.
    • Interface for OpenGL version above 1.1
    • Some extensions are platform specific GLEW can check if they exist on that platform
    • Alternative GL3W, glLoadGen, glad, glsdk, glbinding
  • Using GLEW

    #inculde<GL/glew.h>
    // After initialization OpenGL context:
    glewExperimental = GL_TRUE;
    glewInit(); // Should return GLEW_OK if it initialize or error if fails.
    
    • Can read error with glewGetErrorString(result);
  • What is GLFW?

    • OpenGL Framework
    • Lightweight utility library.
    • uses OpenGL context for windows
    • Handles/Manage Window creation and control.
    • Pick up and process input from the mouse, Keyboard etc.
    • Allow multiple monitor support

Alternatives

  • SFML (Simple and Fast Multimedia Library)
    • OpenGL context is very weak
    • Based on 2D Graphics
  • GLUT (OpenGL Utility Toolkit)
    • outdated No longer maintained(Try to avoid it)
  • Win32 API
    • For the Purist.
    • Lowest level for windows creation.