-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Common: Added new shared library “libgamefw” as a game-side foundation
The Game Framework is the future home of all common code that is shared by all the games and possibly other plugins as well. The code in the “common” directory should be eventually relocated there.
- Loading branch information
Showing
6 changed files
with
111 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Doomsday Engine -- libgamefw: Game base framework and common routines | ||
|
||
cmake_minimum_required (VERSION 3.1) | ||
project (DENG_LIBGAMEFW) | ||
include (../../../cmake/Config.cmake) | ||
|
||
# Dependencies. | ||
find_package (DengCore) | ||
find_package (DengLegacy) | ||
|
||
# Definitions. | ||
add_definitions ( | ||
-D__LIBGAMEFW__=1 | ||
) | ||
|
||
# Set up the API. | ||
include_directories (${DENG_API_DIR}) | ||
|
||
# Source and header files. | ||
file (GLOB_RECURSE HEADERS include/gamefw/*) | ||
|
||
deng_merge_sources (libgamefw src/*.cpp) | ||
|
||
deng_add_library (libgamefw ${SOURCES} ${HEADERS}) | ||
target_link_libraries (libgamefw | ||
PUBLIC Deng::libcore Deng::liblegacy | ||
) | ||
|
||
if (DENG_ENABLE_SDK) | ||
install (DIRECTORY include/gamefw | ||
DESTINATION include | ||
COMPONENT sdk | ||
) | ||
endif () | ||
deng_deploy_library (libgamefw DengGamefw) |
50 changes: 50 additions & 0 deletions
50
doomsday/apps/plugins/libgamefw/include/gamefw/libgamefw.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** @file libgamefw.h Common framework for games. | ||
* | ||
* @authors Copyright (c) 2016 Jaakko Keränen <jaakko.keranen@iki.fi> | ||
* | ||
* @par License | ||
* GPL: http://www.gnu.org/licenses/gpl.html | ||
* | ||
* <small>This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. This program is distributed in the hope that it | ||
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty | ||
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
* Public License for more details. You should have received a copy of the GNU | ||
* General Public License along with this program; if not, see: | ||
* http://www.gnu.org/licenses</small> | ||
*/ | ||
|
||
#ifndef LIBGAMEFW_H | ||
#define LIBGAMEFW_H | ||
|
||
/* | ||
* The LIBGAMEFW_PUBLIC macro is used for declaring exported symbols. It must be | ||
* applied in all exported classes and functions. DEF files are not used for | ||
* exporting symbols on Windows. | ||
*/ | ||
#if defined(_WIN32) && defined(_MSC_VER) | ||
# ifdef __LIBGAMEFW__ | ||
// This is defined when compiling the library. | ||
# define LIBGAMEFW_PUBLIC __declspec(dllexport) | ||
# else | ||
# define LIBGAMEFW_PUBLIC __declspec(dllimport) | ||
# endif | ||
#else | ||
// No need to use any special declarators. | ||
# define LIBGAMEFW_PUBLIC | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
|
||
/// libgamefw uses the @c gfw namespace for all its C++ symbols. | ||
namespace gfw { | ||
|
||
|
||
|
||
} // namespace gfw | ||
|
||
#endif // __cplusplus | ||
|
||
#endif // LIBGAMEFW_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
find_package (DengCore REQUIRED) | ||
find_package (DengLegacy REQUIRED) | ||
|
||
# Deng::libgamefw may exist in the current build, in which case using | ||
# a previously installed version is inappropriate. | ||
if (NOT TARGET Deng::libgamefw) | ||
include ("${CMAKE_CURRENT_LIST_DIR}/DengGamefw.cmake") | ||
endif () |