Skip to content

Miniature graphics engine made as a practice project with glfw, glad, boost and imgui

License

Notifications You must be signed in to change notification settings

mat-kubiak/OpenGL-Mini-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenGL Mini Engine

A simplistic OpenGL 3D graphics engine written in C++ with the help of premake build system.

Cross-platform compatible with Linux AND Windows!

Dependencies

Note: All dependencies besides the build tools are already included in the vendor directory and don't have to be installed.

Build system:

  • premake5
  • make and g++ or visual studio

Graphics API:

  • GLFW3 3.3.8
  • Glad for C/C++ with Core OpenGL 3.3

Miscellaneous:

  • Boost 1.80.0
  • GLM 0.9.8.5
  • Stb Image
  • Dear ImGui

Compile & run

Simply run the premake5 executable with the action that suits you, and then compile this action in the build directory. I've also attached two examples of how I'd do it with Visual Studio and Make:

Note: On Linux, the premake5 resources action will throw a message cp: target 'build/app/bin/Debug/': No such file or directory. You can safely disregard it.

Visual Studio (Windows):

premake5 vs2022
MSBuild .\build\OpenGL-Mini-Engine.sln -p:Configuration=Release
premake5 resources

# you can now run the app!
.\build\app\bin\Release\Engine.exe

Make (Linux):

premake5 gmake2
make -C build App
premake5 resources

# you can now run the app!
./build/app/bin/Release/Engine

Afterward, all project files are available in the build/app/bin/Release/ directory, you can safely move it and use wherever you want. If you encounter some problems, look into log.txt in %APPDATA$\OpenGL-Mini-Engine (Windows) or ~/.config/OpenGL-Mini-Engine (Linux).

Documentation

The project has configured support for doxygen, so you can easily generate documentation using:

premake5 docs

which you can access by opening build/html/index.html in your browser.

Coding Style

I use chromium auto formatter and apply my custom naming style:

Types:

  • class and enums: UpperCamelCase
  • interfaces: IUpperCamelCase (with preceding I)
  • typedefs: snake_case_t (with leading _t)

Symbols:

  • functions: lowerCamelCase
  • variables: snake_case
  • enum values and constants: UPPER_CASE

Preprocessor:

  • header guards: PACKAGE_FILENAME_H_
  • macros: UPPER_CASE_M (with leading _M)

File system:

  • packages/src directories: snake_case
  • filenames: .cpp and .h

Example code:

// inside src/core_gameplay/style_maker.h

#ifndef COREGAMEPLAY_STYLEMAKER_H_
#define COREGAMEPLAY_STYLEMAKER_H_

#define MACRO_M "just a macro"

typedef std::string str_t;

class StyleMaker {
  str_t normal_variable;
  const str_t CONSTANT;

 public:
  bool checkStyle(const str_t& good);
};

#endif
// inside src/core_gameplay/style_maker.cpp

#include "core/style_maker.h"

bool StyleMaker::checkStyle(const str_t& good) {
  if (good == "good") {
    return true;
  } else if (good == "maybe") {
    return true;
  }
  return false;
}

License

This project is released under the GNU Public License v3.

About

Miniature graphics engine made as a practice project with glfw, glad, boost and imgui

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published