Skip to content

Commit

Permalink
Merge branch 'gwork' into ponder
Browse files Browse the repository at this point in the history
* gwork: (54 commits)
  Use for-range
  Store and restore OpenGL states whilst rendering - Thanks to @lonestarr - garrynewman/GWEN#59
  Tidy.
  Specific directory for SFML2 resource loading - Use directory relative to application executable. - Fixes issue #29 - Fix app resource copy for non-bundled apps.
  Add editor config.
  Use cmake file properties to set bundle resources for OSX.
  Replace deprecated method - SFML2.4 setColor deprecated
  Tidy.
  If tall menu descends off screen then clamp to screen height - Thanks to @qehgt - garrynewman/GWEN@c8aacf8
  Include correct dialog header. - Thanks to @kklouzal - garrynewman/GWEN#95
  Correct spelling of caret. - Thanks to @kklouzal garrynewman/GWEN#93
  comment cannot be on same line.
  Disable use of CTT for color picker. - Address issue #27. - Temporarily disable cache to texture. Broken with Allegro 5.2.
  cmake: Make MacOS package - This fixes hi-res screen for Allegro5. See Allegro5 notes on building apps for OSX. Use C++11 def to build C++11.
  Add <cctype> header for std::isprint
  Changes to get GWork to compile on Windows/VS2015
  Use DebugBreak to break into debugger - cross platform debug break to fix issue #25
  - Correct readme - simplify gitignore
  - Output bin/lib to root. - cmake -D doesn't like spaces - Readme: use Allegro 5 instead of SDL2 as clipping bug not fixed
  Clarify origin of std::isprint
  ...

# Conflicts:
#	cmake/Modules/FindAllegro5.cmake
#	cmgen.sh
#	source/gwork/include/Gwork/Skins/Simple.h
#	source/gwork/include/Gwork/Skins/TexturedBase.h
#	source/gwork/source/Events.cpp
#	source/platform/renderers/Allegro5/Allegro5.cpp
#	source/platform/renderers/Direct2D/Direct2D.cpp
#	source/platform/renderers/DirectX9/DirectX9.cpp
#	source/platform/renderers/GDIPlus/GDIPlus.cpp
#	source/platform/renderers/OpenGL/OpenGL.cpp
#	source/samples/Allegro5/Allegro5Sample.cpp
#	source/test/source/api/Button.cpp
  • Loading branch information
billyquith committed Aug 14, 2016
2 parents b68d1c7 + 1e7b5c5 commit d704862
Show file tree
Hide file tree
Showing 95 changed files with 11,860 additions and 2,609 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Configuration file for EditorConfig
# More information is available under http://EditorConfig.org

# Ignore any other files further up in the file system
root = true

# Configuration for all files
[*]
# Always end files with a blank line
insert_final_newline = true
# Force space characters for indentation
indent_style = space
# Always indent by 4 characters
indent_size = 4
# Remove whitespace characters at the end of line
trim_trailing_whitespace = true
# Enforce Unix style line endings (\n only)
#end_of_line = lf
196 changes: 3 additions & 193 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,197 +1,7 @@

*.doxcfg

#################
## Cmake
#################

CMakeCache.txt
CMakeFiles
CMakeScripts
Makefile
cmake_install.cmake
install_manifest.txt

.ninja_deps
.ninja_log
*.ninja

#################
## Eclipse
#################

*.pydevproject
.project
.metadata
#bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

# External tool builders
.externalToolBuilders/

# Locally stored "Eclipse launch configurations"
*.launch

# CDT-specific
.cproject

# PDT-specific
.buildpath


#################
## Visual Studio
#################

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results
**/[Dd]ebug/
**/[Rr]elease/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.vspscc
.builds
**/*.dotCover

## TODO: If you have NuGet Package Restore enabled, uncomment this
#**/packages/

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf

# Visual Studio profiler
*.psess
*.vsp

# ReSharper is a .NET coding add-in
_ReSharper*

# Installshield output folder
[Ee]xpress

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish

# Others
#[Bb]in
[Oo]bj
sql
TestResults
*.Cache
ClientBin
stylecop.*
~$*
*.dbmdl
Generated_Code #added for RIA/Silverlight projects

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML


############
## Windows
############

# Windows image file caches
Thumbs.db

# Folder config file
Desktop.ini


#############
## Python
#############

*.py[co]

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
#bin
var
sdist
develop-eggs
.installed.cfg

# Installer logs
pip-log.txt

# Unit test / coverage reports
.coverage
.tox

#Translations
*.mo

#Mr Developer
.mr.developer.cfg

# Mac crap
.DS_Store
*.dylib
*.a

############
## Xcode
############

*.pbxproj
xcschemes
*.xcuserstate
*.xcsettings
*.xcworkspacedata
*.xcuserdatad
*Instruments.trace*

bin/
lib/

build*/
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# output directory
set(CMAKE_BINARY_DIR "${CMAKE_HOME_DIRECTORY}/build")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) # exe
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) # .a
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) # .dylib
make_directory(${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/bin) # exe
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/bin) # .dylib
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/lib) # .a
make_directory(${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
make_directory(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})

add_definitions(-std=c++11)

# configure projects
include(${CMAKE_SOURCE_DIR}/cmake/Config.cmake)
Expand Down
52 changes: 46 additions & 6 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,50 @@
MIT License

Copyright (C) 2012 Garry Newman
Copyright (C) 2015-2016 Billy Quith
GWEN/Gwork - MIT License
------------------------

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:
- Copyright (C) 2012 Garry Newman
- Copyright (C) 2015-2016 Bill Quith

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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 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.
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.


Debug Break
-----------

Copyright (c) 2011-2015, Scott Tsai

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
36 changes: 21 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ Gwork (*pronounced "gw-orc"*) is a fork of the GUI library [GWEN][gwen]. It was
to fix issues with GWEN and add new features.

A number of rendering backends are provided for use, or as an example for your own:

* [Allegro5][al5] (cross-platform).
* TODO: Direct2D (Windows).
* TODO: DirectX9 (Windows).
* TODO: GDI+ (Windows).
* OpenGL (cross-platform using GLFW).
* [SDL2][sdl2] (cross-platform).
* [SFML2][sfml2] (cross-platform).

Expand All @@ -21,20 +20,28 @@ Get source code:
* From git: `git clone https://github.com/billyquith/GWork.git gwork` or
* [Download zip](https://github.com/billyquith/GWork/archive/gwork.zip) & unzip

CMake is used to generate the project files.
CMake is used to generate the project files. See `cmake -h` to see all the generators for
your platform. Only have one renderer per build directory. Choose renderer:

* `-DRENDER_ALLEGRO5=ON`
* `-DRENDER_OPENGL=ON`
* `-DRENDER_SDL2=ON`
* `-DRENDER_SFML2=ON`

For example to build Allegro 5 renderer using Ninja:

```bash
cd gwork
cmake -G Ninja -DRENDER_SDL2=ON # create Ninja project files with SDL2 renderer
mkdir build && cd build # put build files in subdirectory
cmake -GNinja -DRENDER_ALLEGRO5=ON .. # create Ninja project files
```

Providing the dependencies are present, this will create a sample executable. When run it will
demonstrate all of the controls available:

```bash
ninja # build project
cd build/bin
./GworkSDL2Sample
ninja # build project
bin/GworkAllegro5Sample # run sample
```

## Changes from GWEN
Expand All @@ -44,7 +51,6 @@ cd build/bin
* CMake is used to generate project files instead of Premake. CMake is much more
comprehensive.
* [SDL2][sdl2] renderer added.
* C++11 used.
* [UTF-8 everywhere][5]. Unicode support simplified.
* `Gwen::UnicodeString` removed. This assumed that all Unicode was best as a
wide encoding. This is not the case on all platforms.
Expand All @@ -54,6 +60,7 @@ cd build/bin
* Documentation:
* Any existing GWEN comments and docs formatted for [doxygen](http://doxygen.org).
* Docs currently very minimal as GWEN has almost no documentation.
* C++11 used.
* Cache to texture optimisation implemented (Allegro only).
* No dependency on Bootil (Garry's personal library).
* Fixes for [Allegro][al5]. e.g. text rendering.
Expand All @@ -67,22 +74,21 @@ cd build/bin
Github, Google Code, etc use 8 space tabs. GWEN uses 4 space tabs. This
messes up the indentation when reading code on Github.
* Brackets: [Allman][2]/BSD indentation.
* Line length ~100 chars. Github has width around 100. Easier for
3 way merge. Everything on regular screen.
* Line length ~100 chars. Github has width around 100. Easier for 3 way merge. Everything
on regular screen.
* camelCase variables.

Please [report problems to Github][7] or they'll get lost.
Please [report problems to Github][issues] or they'll get lost.

BQ

[gwen]: https://github.com/garrynewman/GWEN
[sdl2]: https://www.libsdl.org/
[sfml2]: http://www.sfml-dev.org
[al5]: http://alleg.sourceforge.net
[issues]: https://github.com/billyquith/GWork/issues "Bugs/Issues"
[1]: http://www.codinghorror.com/blog/2009/04/death-to-the-space-infidels.html "Interesting article on consistency"
[2]: http://en.wikipedia.org/wiki/Indent_style#Allman_style "Not uncommon"
[5]: http://www.utf8everywhere.org "Why you should use UTF8 everywhere."
[6]: http://industriousone.com/premake
[7]: https://github.com/billyquith/GWork/issues "Bugs/Issues"


BQ
Loading

0 comments on commit d704862

Please sign in to comment.