Skip to content

jseward/solar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this?

An opinionated c++11 game engine. Evolved from the internal game engine used by Ironclad Games (Sins of a Solar Empire, Sins of a Dark Age)

Used by

Features

  • consistent archiving system that supports reading/writing to binary/json/packets/etc.
  • platform abstraction of everything (ex. file io, mouse input, keyboard input)
  • directory change watching. all data files support being reloaded on the fly.
  • flexible setting system for user settings
  • text localization.
  • scalable fonts.
  • rendering meshes with shaders.
  • window ui layer with support for common controls: buttons, text entry, etc.

Internals

  • no global variables and no singletons.
  • uses c++11.
  • uses stl containers mostly, but provides some custom containers useful for games.
    • fixed_vector (std::vector with a fixed size)
    • linked_list (custom list class where memory allocation is controlled much easier)
  • minimal dependencies (see below)

Platforms supported

  • Direct3D9
  • Win32
  • more to come

Coding Style

  • picked to conform to std library and c++ in general
    • all types and variables lowercase with underscores
    • macros and enum values all uppercase with underscores
    • template parameters are mixed case
    • open brackets start on same line

Dependencies

How to use?

Easiest to look at peon and solar_tools for examples. Add the appropriate _buildbuild_x files to your project that will build solar into your app.

String Formatting

Tips and Tricks

  • containers/container_helpers.h has lots of helpful one line functions for doing common container ops.
  • convert a container (ex. std::vector) into a comma seperated std::string using build_container_string() found in strings/string_build.h

Preprocessor macros

SOLAR__JSON_ARCHIVE_READER_NO_ALERT_UNUSED_VALUES
disables alerts that json values read from the file are being unused by the code. this is potentially expensive due to all the string tracking.

SOLAR__NO_FILE_CHANGE_WATCHER
disables file watching, should be #defined on release builds as file watching is mainly for dev convienence

About

C++11 game engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published