Skip to content
Permalink
Browse files

Rendering system rewrite, tons of refactoring, optimizations, and oth…

…er cool stuff (#116)
  • Loading branch information...
Akaricchi committed Apr 12, 2018
1 parent 67ee59f commit 59cf8f630005a66c4dfea491af6870b3b395142b
Showing 457 changed files with 45,012 additions and 6,149 deletions.
@@ -5,3 +5,6 @@ osxbuild/
.*DS_Store
__pycache__
*.out
*.kdev4
.kdev4/
*.kate-swp
@@ -21,7 +21,7 @@ Dependencies
- libzip >= 1.0
- libpng >= 1.5.0
- libjpeg
- OpenGL >= 2.1
- OpenGL >= 3.3

Build-only dependencies
^^^^^^^^^^^^^^^^^^^^^^^
@@ -0,0 +1,37 @@

atlases_dir = meson.current_source_dir()
atlases_overrides_dir = join_paths(atlases_dir, 'overrides')

# TODO: find a nice way to scale this over multiple atlas directories, if needed.

run_target('gen-atlases',
command: [
gen_atlases_command,
atlases_overrides_dir,
join_paths(atlases_dir, 'common'),
join_paths(resources_dir, 'gfx'),
'--name', 'common',
'--width', '4096',
'--height', '4096',
'--border', '1',
'--single',
'--crop',
'--leanify',
],
)

run_target('gen-atlases-fast',
command: [
gen_atlases_command,
atlases_overrides_dir,
join_paths(atlases_dir, 'common'),
join_paths(resources_dir, 'gfx'),
'--name', 'common',
'--width', '4096',
'--height', '4096',
'--border', '1',
'--single',
'--crop',
'--no-leanify',
],
)
@@ -85,7 +85,13 @@ Resources

If ``1``, the game will crash with an error message when it attempts to
use a resource that hasn't been previously preloaded. Useful for
developers to debug missing preloads. Doesn't affect optional resources.
developers to debug missing preloads.

**TAISEI_PRELOAD_SHADERS**
| Default: ``0``

If ``1``, Taisei will load all shader programs at startup. This is mainly
useful for developers to quickly ensure that none of them fail to compile.

Video and OpenGL
~~~~~~~~~~~~~~~~
@@ -104,6 +110,17 @@ Video and OpenGL

Use ``SDL_VIDEODRIVER`` instead.

**TAISEI_RENDERER**
| Default: ``gl33``

Selects the rendering backend to use. Currently available options are:

- ``gl33``: the OpenGL 3.3 Core renderer
- ``null``: the no-op renderer (nothing is displayed)

Note that the actual subset of usable backends, as well as the default
choice, can be controlled by build options.

**TAISEI_LIBGL**
| Default: unset

@@ -113,21 +130,34 @@ Video and OpenGL
Taisei is linked to libgl (which is not recommended, because it's not
portable).

**TAISEI_GL_DEBUG**
| Default: ``0`` for release builds, ``1`` for debug builds

Enables OpenGL debugging. A debug context will be requested, all OpenGL
messages will be logged, and errors are fatal. Requires the ``KHR_debug``
or ``ARB_debug_output`` extension.

**TAISEI_GL_EXT_OVERRIDES**
| Default: unset

Space-separated list of OpenGL extensions that are assumed to be
supported, even if the driver says they aren't. Prefix an extension with
``-`` to invert this behaviour. Might be used to work around bugs in
some weird/ancient/broken drivers, but your chances are slim. Also note
that Taisei assumes many extensions to be available on any sane OpenGL
2.1+ implementation and doesn't test for them, so you can't disable code
that uses those this way.
some weird/ancient/broken drivers, but your chances are slim. Note that
this only affects code paths that actually test for the given extensions,
not the actual OpenGL functionality. Some OpenGL implementations (such as
Mesa) provide their own mechanisms for controlling extensions. You most
likely want to use that instead.

**TAISEI_FRAMERATE_GRAPHS**
| Default: ``0`` for release builds, ``1`` for debug builds

if ``1``, framerate graphs will be drawn on the HUD.
If ``1``, framerate graphs will be drawn on the HUD.

**TAISEI_OBJPOOL_STATS**
| Default: ``0`` for release builds, ``1`` for debug builds

Displays some statistics about usage of in-game objects.

Timing
~~~~~~
@@ -0,0 +1,62 @@
*.xcodeproj
*.xcworkspace
*.sln
*.vcxproj
*.vcxproj.*
*.suo
*.sdf
*.opensdf
ipch/
Debug/
Release/
.DS_Store
.vs
*.nupkg
*.opendb
packages.config
/aclocal.m4
/ar-lib
/autom4te.cache/
/compile
/config.guess
/config.log
/config.status
/config.sub
/configure
/depcomp
/install-sh
/ltmain.sh
/missing
/libtool
/.libs/
.deps/
*.[oa]
*.l[oa]
Makefile
Makefile.in
m4/*.m4
.buildstamp
.dirstamp
packages/
.anjuta/*
*.anjuta*
config.h.*
/config.h
stamp*
COPYING
.idea/*
*.VC.db
cscope.*
*-git-ignored-file.*
test/*.trs
test/test_*
*.log
test-*
test/.libs/*
test/tests
cglm_arm/*
cglm_test_ios/*
cglm_test_iosTests/*
docs/build/*
win/cglm_test_*
* copy.*
@@ -0,0 +1,3 @@
[submodule "test/lib/cmocka"]
path = test/lib/cmocka
url = git://git.cryptomilk.org/projects/cmocka.git
@@ -0,0 +1,11 @@
; DO NOT EDIT (unless you know what you are doing)
;
; This subdirectory is a git "subrepo", and this file is maintained by the
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
;
[subrepo]
remote = https://github.com/taisei-project/cglm
branch = taisei
commit = 5af24c6b834fd85bb41ae2520f7030c1b689152e
parent = cc41f444380def4cb5338aeda1204698d14d49f2
cmdver = 0.3.1
@@ -0,0 +1,59 @@
language: c

os:
- linux
- osx

sudo: required
dist: trusty

compiler:
- clang
- gcc

matrix:
fast_finish: true
exclude:
# Skip GCC builds on macOS.
- os: osx
compiler: gcc
include:
# Additional GCC builds for code coverage.
- os: linux
compiler: gcc
env: CODE_COVERAGE=ON

cache:
apt: true

addons:
apt:
packages:
- clang-3.6
- lcov

branches:
only:
- master

script:
- sh ./build-deps.sh
- sh ./autogen.sh
- if [[ "$CC" == "gcc" && "$CODE_COVERAGE" == "ON" ]]; then
./configure CFLAGS="-ftest-coverage -fprofile-arcs";
else
./configure;
fi
- make
- make check

after_success:
- if [[ "$CC" == "gcc" && "$CODE_COVERAGE" == "ON" ]]; then
pip install --user cpp-coveralls
coveralls
--build-root .
--exclude lib
--exclude test
--gcov-options '\-lp'
--verbose;
fi
@@ -0,0 +1,53 @@
# CONTRIBUTING

Any contributions (code, documentation, ...) are welcome. This project uses [cmocka](http://cmocka.org) for testing, you may need to check their documentation

# New Features
- This library may not accept all new features, it is better to create an issue and get approval before coding
- You must add test for every new feature
- The feature must be compiled in both UNIX/POSIX systems (e.g. macos, linux...) and Windows

# Code Style
This library is written with C99, don't try to add C++ files (yes it can compiled into lib),
if you have enough reason to add C++ files than create an issue and get approval before coding,

- All functions must have `glm` prefix
- Lines should be wrapped at 80 characters.
- Don't invent new style for existing ones
- Use C89 style comments (`/* comments */`) not C++ style comments (`// comments`)
- Don't use TABs instead use 2 spaces for TABs
- All indents must be 2 spaces, not 1 nor 4 space
- All functions in `include` folder must be exported by `CGLM_EXPORT` and wrapped by `extern "C" {` for C++
- Crate new line for return type, attribs:

```C
CGLM_INLINE
void
glm_mul(mat4 m1, mat4 m2, mat4 dest)
```
not acceptable:
```C
CGLM_INLINE void glm_mul(mat4 m1, mat4 m2, mat4 dest)
```
- Variables must be declared at the top of a scope before usage:
```C
int x;
int y;
x = y = 0;
```

not acceptable:

```C
int x;
x = 0;
int y = 0;
```

- All files must retain same LICENSE statement
- Code with warnings will not be accepted, please suppress them (not by disabling them)
- Run code anaylysis before submitting pull requests, if you use Xcode you can enable Sanitizer in scheme, you can use valgrind in linux
@@ -0,0 +1,69 @@
The MIT License (MIT)

Copyright (c) 2015 Recep Aslantas <info@recp.me>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

-

This library [initially] used some [piece of] implementations
(may include codes) from these open source projects/resources:

1. Affine Transforms
The original glm repo (g-truc), url: https://github.com/g-truc/glm

LICENSE[S]:
The Happy Bunny License (Modified MIT License)
The MIT License
Copyright (c) 2005 - 2016 G-Truc Creation

FULL LICENSE: https://github.com/g-truc/glm/blob/master/copying.txt

2. Quaternions
Anton's OpenGL 4 Tutorials book source code:

LICENSE:
OpenGL 4 Example Code.
Accompanies written series "Anton's OpenGL 4 Tutorials"
Email: anton at antongerdelan dot net
First version 27 Jan 2014
Copyright Dr Anton Gerdelan, Trinity College Dublin, Ireland.

3. Euler Angles
David Eberly
Geometric Tools, LLC http://www.geometrictools.com/
Copyright (c) 1998-2016. All Rights Reserved.

Computing Euler angles from a rotation matrix (euler.pdf)
Gregory G. Slabaugh

4. Extracting Planes
Fast Extraction of Viewing Frustum Planes from the World-View-Projection Matrix
Authors:
Gil Gribb (ggribb@ravensoft.com)
Klaus Hartmann (k_hartmann@osnabrueck.netsurf.de)

5. Transform AABB
Transform Axis Aligned Bounding Boxes:
http://dev.theomader.com/transform-bounding-boxes/
https://github.com/erich666/GraphicsGems/blob/master/gems/TransBox.c

6. Cull frustum
http://www.txutxi.com/?p=584
http://old.cescg.org/CESCG-2002/DSykoraJJelinek/
Oops, something went wrong.

0 comments on commit 59cf8f6

Please sign in to comment.
You can’t perform that action at this time.