Skip to content
/ OpenGL Public

A minimal, windows only self-contained OpenGL Demo!

Notifications You must be signed in to change notification settings

Macawls/OpenGL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Running

This project only works on Windows 64-bit 😎👍

Download the latest release on the here

The exe is portable, simply double click it to run

Setup

Dependencies

All dependencies are included in the source

Compiling

  1. Follow these steps to setup MinGW-w64 via MSYS2 on Windows

  2. Make sure you have python and g++ installed

  3. Use python compiler.py --help for more information

Help Menu

--run       Run the executable
--clean     Clean the build directory
--build     Build the source
--release   Builds for release

Standard Commands

Standard Build

python compiler.py --build

Run after building

python compiler.py --build --run

Build for release (adds rc files, release flags, etc)

python compiler.py --build --release

Tools and Misc

You can find various tools under the tools directory. Most of them are for converting files into an appropriate header file format for embedding.

Custom Font for IMGUI

Relevant ImGUI Source

.\binary_to_compressed.exe font.ttf font > font.h

Make sure the final file is encoded as UTF-8 👍

ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(
        font_compressed_data, 
        font_compressed_size, fontSize);

Converting Images

From the glfw documentation,

The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits per channel with the red channel first. They are arranged canonically as packed sequential rows, starting from the top-left corner"

I figured since stbi_load works seamlessly you can use the following binary to write image data to a .h file.

.\image_to_header.exe name.png output.h