Coder Social home page Coder Social logo

andystanton / glfw-skeleton Goto Github PK

View Code? Open in Web Editor NEW
24.0 5.0 1.0 2.99 MB

:skull: A skeleton OpenGL C++ app bootstrapped with glfw, glad, and glm.

Home Page: https://andystanton.github.io/glfw-skeleton/

License: MIT License

CMake 10.80% C++ 85.60% Makefile 1.74% GLSL 1.86%
glfw opengl skeleton c-plus-plus cpp glfw-skeleton cmake glm rapid-development

glfw-skeleton's People

Contributors

andystanton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

seanbutler

glfw-skeleton's Issues

Build and run tests using a Docker container

Build a Dockerfile that builds and runs the unit tests.
The base image Ubuntu 14.04 should be used as this supports gcc 4.9 through the test toolchain.

This task will be complete when:

  • A Dockerfile exists
  • The Dockerfile is based on Ubuntu 14.04
  • The Dockerfile installs gcc 4.9
  • The Dockerfile clones the glfw skeleton source
  • The Dockerfile builds the glfw skeleton source
  • The Dockerfile tests the glfw skeleton source
  • A success code is returned if the tests have passed
  • A failure code is returned if the tests have failed

Set up CI server capable of running Docker

I use Travis CI to do automated builds on github commits of glfw skeleton. Travis uses Ubuntu 12.04 which supports up to gcc 4.8. Some of the C++11 regex features are only supported from gcc 4.9.

I tried building gcc 4.9 from source in the travis pre install steps but this involves a +100 MB download which is slow and excessive, and therefore not good for CI. Another service, drone.io offers a service similar to Travis, and unfortunately the only available version of gcc is 4.8.

Instead I want to investigate setting up a CI server myself that is capable of running Docker, so that I have a guaranteed way of using all C++11 features.

Links:

Add ability to toggle colour logging output

The application's logging outputs in colour using ansi escape code. This should be optional via a toggle so that it outputs correctly in terminals that do not support ansi colour e.g. CLion IDE, Windows command prompt.

This task will be complete when:

  • The logging can be output using ansi colour.
  • The logging can be output without using ansi colour.

rake clean doesn't clean everything

The glfw library generates a configuration header based on the OS that cmake was invoked from. This header file is not deleted, so in the event the cmake'd sources are copied to another OS, some settings specific to the previous OS may be maintained despite the rake clean task.

Either the above process is bad or git clean should be invoked to clean each source root as follows:

git clean -dff
git clean -dffX

The first cleans everything except the contents of .gitignore. The second cleans only the contents of .gitignore.

Make eyes transparent

Currently the eyes are black squares. Instead draw white rectangles around the voids so that the background colour shows through instead of black.

Add logging

There is currently no logging beyond using cout.

I had a look before for c++ libraries similar to log4j but there weren't any recently maintained ones. I think I'll write a simple one for now to prevent messing around with cout.

This task will be complete when:

  • A logger class exists.
  • A logger factory class exists that manages instances of Loggers.
  • All existing standard out logging are switched to make use of the new class.

Add command line interface (CLI)

The application should accept command line options.

  • A CLI class should parse the input supplied to the application.
  • The CLI should include no-colour=true|false for toggling #17.

Improvements for 3.0.1

  • Add more parameters to drawSkull method - colour and scale
  • Add a colour helper
  • Remove Adder/Multiplier headers
  • Change tabs to spaces in .gitmodules

Add application configuration storage

The configuration should be encapsulated in a class.

This task is complete when:

  • There is a storage mechanism for the config.
  • The CLI options are read into the config.
  • The configuration can be read as a string.
  • The configuration can be read as a boolean.
  • The configuration can be read as an integer.

rake command succeeds when tests fail

If the tests fail when run using the rake test goal, the rake command still succeeds. This is bad because CI builds depend on a bad exit code from rake to determine whether or not the build succeeded.

----------------------------------------------------------
Test Failed.
"glfw-skeleton-unittests" end time: Sep 21 20:38 UTC
"glfw-skeleton-unittests" time elapsed: 00:00:00
----------------------------------------------------------
End testing: Sep 21 20:38 UTC
The command "rake all" exited with 0.

Create distributable artifacts

A user of this project should be able to extend it and then easily distribute it. The project builds an executable and copies shaders to the build output path. This means that sharing the application involves multiple files and does not automatically end up in the standard OS location for programs.

macOS has the concept of app bundles that are a folder that contains the executable and resources, and is treated as an executable itself. CMake allows the creation of app bundles as well as the ability to create a dmg image for distribution. There is a fixed folder structure required by app bundles, so some changes are likely to be required in the code that loads resources.

Windows does not have an equivalent to the macOS app bundle and applications are typically installed in their own folder in Program Files. CMake has the ability to create NSIS installers which can be used for distribution.

I don't know what the standard way to distribute Linux GUI apps is.

This outcome of this issue is to confirm what the distributable formats should be, and then implement it. Ideally this will be through mechanisms provided by CMake.

Lots of errors...

Executing default...
Executing configure...
mkdir -p build
cmake  ..
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at CMakeLists.txt:85 (ADD_SUBDIRECTORY):
  The source directory

    /home/cheapskate01/glfw-skeleton-master/lib/glfw

  does not contain a CMakeLists.txt file.


CMake Error at CMakeLists.txt:93 (ADD_SUBDIRECTORY):
  The source directory

    /home/cheapskate01/glfw-skeleton-master/lib/glew

  does not contain a CMakeLists.txt file.


CMake Error at CMakeLists.txt:105 (ADD_SUBDIRECTORY):
  The source directory

    /home/cheapskate01/glfw-skeleton-master/lib/gmock

  does not contain a CMakeLists.txt file.


CMake Error at CMakeLists.txt:110 (SET_PROPERTY):
  set_property could not find TARGET gmock.  Perhaps it has not yet been
  created.


CMake Error at CMakeLists.txt:111 (SET_PROPERTY):
  set_property could not find TARGET gmock_main.  Perhaps it has not yet been
  created.


CMake Error at CMakeLists.txt:112 (SET_PROPERTY):
  set_property could not find TARGET gtest.  Perhaps it has not yet been
  created.


CMake Error at CMakeLists.txt:113 (SET_PROPERTY):
  set_property could not find TARGET gtest_main.  Perhaps it has not yet been
  created.


CMake Error at CMakeLists.txt:123 (ADD_SUBDIRECTORY):
      The source directory

    /home/cheapskate01/glfw-skeleton-master/lib/bandit

  does not contain a CMakeLists.txt file.


-- Copying contents of directory /home/cheapskate01/glfw-skeleton-master/src/shaders to          /home/cheapskate01/glfw-skeleton-master/build/bin
-- Copying file skull.vertexshader
-- Copying file skull.fragmentshader
-- Configuring incomplete, errors occurred!
See also "/home/cheapskate01/glfw-skeleton-master/build/CMakeFiles/CMakeOutput.log".
rake aborted!
Command failed with status (1): [cmake  .....]
/home/cheapskate01/glfw-skeleton-master/rakefile:67:in `block (2 levels) in <top (required)>'
/home/cheapskate01/glfw-skeleton-master/rakefile:66:in `chdir'
/home/cheapskate01/glfw-skeleton-master/rakefile:66:in `block in <top (required)>'
/home/cheapskate01/glfw-skeleton-master/rakefile:103:in `block in <top (required)>'
Tasks: TOP => configure
(See full trace by running task with --trace)

Remove test tests (bandit & snowhouse)

When building, as bandit (and by association, snowhouse) are included as cmake subdirectories, they are built and their tests run. While this may be desirable for debugging why tests aren't working, it's not necessary most of the time.

I submitted some PRs to bandit and snowhouse to allow their tests to be disabled which have now been merged. They can be used with the current master branch of snowhouse (ffa30f3961cea3d2d22cac245eab6003e546e4e8) so this task will update the version of snowhouse to that revision.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.