A C++14 framework for 2D games
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
cmake
data/gf_tools
docs
examples
games
include/gf
library
tests use the new streams, especially in serialization Sep 21, 2018
tools
.gitignore
.gitmodules
.travis.yml try with a Brewfile May 28, 2018
AUTHORS.md
Brewfile try with a Brewfile May 28, 2018
CMakeLists.txt
CODE_OF_CONDUCT.md
CONTRIBUTING.md
ChangeLog.md
Doxyfile.cmake
LICENSE.txt update copyright year in LICENSE.txt Apr 20, 2018
README.md
appveyor.yml add missing option to remove outdated packages in Appveryor Apr 13, 2018
gf_logo.png

README.md

Gamedev Framework (gf)

Travis AppVeyor Language grade: C/C++ GitHub license GitHub tag

Gamedev Framework (gf) is a framework to build 2D games in C++14. It is based on SDL and OpenGL ES 2.0, and presents an API that is very similar to the graphics module of SFML with additional features. It is not a game engine, it is more something like a framework, similar to libGDX in the Java world.

Gamedev Framework (gf) is licensed under the terms and conditions of the zlib/libpng license.

Gamedev Framework (gf)

Quick example

#include <gf/Event.h>
#include <gf/Font.h>
#include <gf/RenderWindow.h>
#include <gf/Sprite.h>
#include <gf/Text.h>
#include <gf/Window.h>

int main() {
  // Create the main window and the renderer
  gf::Window window("Example", { 640, 480 });
  gf::RenderWindow renderer(window);

  // Load a sprite to display

  gf::Texture texture;

  if (!texture.loadFromFile("sprite.png")) {
    return EXIT_FAILURE;
  }

  gf::Sprite sprite(texture);
  sprite.setPosition({ 300, 200 });

  // Create a graphical text to display

  gf::Font font;

  if (!font.loadFromFile("DroidSans.ttf")) {
    return EXIT_FAILURE;
  }

  gf::Text text("Hello gf!", font, 50);
  text.setPosition({ 100, 100 });

  renderer.clear(gf::Color::White);

  // Start the game loop

  while (window.isOpen()) {
    // Process events

    gf::Event event;

    while (window.pollEvent(event)) {
      switch (event.type) {
        case gf::EventType::Closed:
          window.close();
          break;
        default:
          break;
      }
    }

    // Draw the entities

    renderer.clear();
    renderer.draw(sprite);
    renderer.draw(text);
    renderer.display();
  }

  return 0;
}

Documentation

See the online documentation for Gamedev Framework (gf).

Contact

If you want to talk directly with the developpers, you can join the #gf-devel IRC channel on Freenode. Or you can post a message on /r/GamedevFramework.

Contribution

Gamedev Framework (gf) is very open to contributions. See the contribution guidelines.

Dependencies

You have to install the following dependencies:

See the documentation for more information on how to build and install gf.

Screenshots

These screenshots are from games and tools included in the repository.

Games

gf Pong! gf 2048! Huaca Bank Robbery for Dummies Bygone Islands Krokodile Lux

Tools

gf Noise gf Dungeons