/Solar

2D OpenGL game framework.

Primary LanguageC++MIT LicenseMIT

2D OpenGL Game Framework.


Table of Contents


About

Solar framework is free and open-source under the MIT license.

Solar supports 64-bit Windows applications (for now).

Solar is an education project for learning purposes, feel free to use it in personal and commercial projects, just keep in mind that support is minimal.

🚨 Heads up, Solar is evolving... Check out sidekick, Solar's successor, written entirely in Rust.


Features

Current features:

  • Window Management.
  • Cursor Management.
  • Custom Math Library.
  • Mouse Input Handling.
  • Keyboard Input Handling.
  • Gamepad Input Handling.
  • Basic Shapes Rendering (Line, Triangle, Square).
  • Text Rendering.

Planned features:

  • Sprite Rendering.
  • Audio Playing.
  • 2D Physics.
  • 2D Lighting & Shadow.

Tutorials and Documentation

You can refer to the wiki page (whenever it's live 🤷‍♂️) for an in-depth guide to Solar.

Check out PongSolar, a Pong game made with Solar for some sample code.


Contributing

Solar is completely open to community contribution. Any effort to help expand the scope and capability of the framework is greatly appreciated 🤗.


Requirements

  • Visual Studio 2019 (Untested on older versions of Visual Studio) or Visual Studio Code.
  • Microsoft Visual C++ compiler.

Getting Started

Clone Solar repository to your local system using git clone --recursive https://github.com/ThaiDuongVu/Solar.git

Open Solar solution Solar.sln with Visual Studio.

You can see 2 projects in Solar solution: Solar and Lunar.

Solar is the framework itself.

Lunar is a sample project, containing examples with commented code and to showcase the capabilities of Solar framework. Lunar can be safely deleted from the solution.

Solar only supports 64-bit projects therefore Lunar is an only 64-bit application.

Hit Ctrl+Shift+B to build solution.

Hit F5 to run Lunar.


Creating New Projects

  1. Right click on solution and choose Add -> New Project...

  1. Choose C++ Empty Project.

  1. Name your project and hit Create.

  1. Select your newly created project and go to View -> Other Windows -> Property Manager.

  1. Right click on your project and choose Add existing property sheet....

  1. Select SolarSolutionProject.props from solution directory.

  1. Right click on newly created project and set it as startup project.

And voila, you have created a project configured to work with Solar framework, time to jump into the code.

  1. Verify everything is working by creating a main.cpp in the new project and running this code:
        #include <solar.h>
        using namespace Solar;

        int main()
        {
            App *app = new App();
            app->Run();
        }
  1. You should see the following window by default: