Skip to content
This repository has been archived by the owner on Dec 2, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Misc changes, MinGW now works
  • Loading branch information
Rover656 committed Jun 18, 2019
1 parent c35fe1f commit 7a60e56
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 49 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -3,6 +3,9 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# CLion ignore cmake directories
cmake-build-*/

# User-specific files
*.suo
*.user
Expand Down
2 changes: 1 addition & 1 deletion src/3rd-party/raylib
Submodule raylib updated 59 files
+14 −3 BINDINGS.md
+3 −3 CONTRIBUTING.md
+15 −14 LICENSE.md
+1 −0 examples/CMakeLists.txt
+5 −2 examples/Makefile
+3 −1 examples/models/models_animation.c
+112 −0 examples/models/models_waving_cubes.c
+ examples/models/models_waving_cubes.png
+82 −0 examples/shaders/resources/shaders/glsl330/basic_lighting.fs
+33 −0 examples/shaders/resources/shaders/glsl330/basic_lighting.vs
+ examples/shaders/resources/texel_checker.png
+187 −0 examples/shaders/rlights.h
+184 −0 examples/shaders/shaders_basic_lighting.c
+ examples/shaders/shaders_basic_lighting.png
+1 −1 examples/text/resources/pixantiqua.fnt
+ examples/text/resources/pixantiqua.png
+2 −2 games/Makefile
+2 −2 games/drturtle/Makefile
+2 −2 games/koala_seasons/Makefile
+2 −2 games/light_my_ritual/Makefile
+2 −2 games/skully_escape/Makefile
+2 −2 games/transmission/Makefile
+2 −2 games/wave_collector/Makefile
+2 −2 projects/4coder/Makefile
+4 −4 projects/CodeBlocks/core_basic_window.cbp
+2 −2 projects/Geany/raylib_compile_execute.bat
+3 −3 projects/Geany/raylib_compile_sources.bat
+194 −0 projects/VS2017.ANGLE/examples/core_basic_window.vcxproj
+192 −0 projects/VS2017.ANGLE/examples/core_basic_window_cpp.vcxproj
+ projects/VS2017.ANGLE/lib/x64/d3dcompiler_47.dll
+ projects/VS2017.ANGLE/lib/x64/libEGL.dll
+ projects/VS2017.ANGLE/lib/x64/libEGL.lib
+ projects/VS2017.ANGLE/lib/x64/libGLESv2.dll
+ projects/VS2017.ANGLE/lib/x64/libGLESv2.lib
+ projects/VS2017.ANGLE/lib/x86/d3dcompiler_47.dll
+ projects/VS2017.ANGLE/lib/x86/libEGL.dll
+ projects/VS2017.ANGLE/lib/x86/libEGL.lib
+ projects/VS2017.ANGLE/lib/x86/libGLESv2.dll
+ projects/VS2017.ANGLE/lib/x86/libGLESv2.lib
+57 −0 projects/VS2017.ANGLE/raylib.sln
+198 −0 projects/VS2017.ANGLE/raylib/raylib.vcxproj
+2 −2 projects/VS2017.UWP/raylib.App.UWP/raylib.App.UWP.vcxproj
+6 −6 projects/VS2017.UWP/raylib.UWP/raylib.UWP.vcxproj
+4 −4 projects/VS2017/examples/core_basic_window.vcxproj
+4 −4 projects/VS2017/examples/core_basic_window_cpp.vcxproj
+4 −4 projects/VS2017/raylib/raylib.vcxproj
+1 −1 projects/VSCode/.vscode/c_cpp_properties.json
+2 −2 projects/VSCode/.vscode/launch.json
+2 −2 projects/VSCode/.vscode/tasks.json
+2 −2 projects/VSCode/Makefile
+1 −1 src/CMakeLists.txt
+8 −6 src/Makefile
+49 −21 src/camera.h
+1 −1 src/config.h
+28 −29 src/config.h.in
+81 −8 src/core.c
+4 −4 src/models.c
+3 −2 src/raylib.h
+7 −3 src/rlgl.h
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Expand Up @@ -43,6 +43,10 @@ target_include_directories(Ngine PUBLIC "3rd-party/cute-headers")

# Link libraries
target_link_libraries(Ngine raylib)
target_link_libraries(Ngine stdc++fs)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_link_libraries(Ngine -static)
endif()

# Compile definitions
target_compile_definitions(Ngine PRIVATE NGINE_EXPORTS=1)
Expand Down
3 changes: 2 additions & 1 deletion src/Core/WindowManager.cpp
Expand Up @@ -16,7 +16,7 @@ namespace NerdThings::Ngine::Core {

void WindowManager::ApplyConfig(int config_) {
// Build raylib flags
unsigned char raylibFlags = 0;
unsigned int raylibFlags = 0;

if (config_ & FULLSCREEN) raylibFlags |= FULLSCREEN;
if (config_ & RESIZEABLE_WINDOW) raylibFlags |= RESIZEABLE_WINDOW;
Expand All @@ -25,6 +25,7 @@ namespace NerdThings::Ngine::Core {
if (config_ & HIDDEN_WINDOW) raylibFlags |= HIDDEN_WINDOW;
if (config_ & MSAA_4X) raylibFlags |= MSAA_4X;
if (config_ & VSYNC) raylibFlags |= VSYNC;
if (config_ & ALWAYS_RUN_MINIMIZED) raylibFlags |= ALWAYS_RUN_MINIMIZED;

// Apply raylib flags
SetConfigFlags(raylibFlags);
Expand Down
21 changes: 21 additions & 0 deletions src/UI/UIControl.h
Expand Up @@ -23,10 +23,31 @@ namespace NerdThings::Ngine::UI {
class NEAPI UIControl {
// Private Fields

/*
* Control parent, may be null
*/
UIControl *_Parent;
public:

// Public Constructor(s)

// Public Methods

/*
* Get parent as type
*/
template<typename ParentType>
ParentType* GetParent() {
return dynamic_cast<ParentType*>(_Parent);
}
protected:

// Protected Methods

/*
* Set parent, used by panels mostly
*/
void SetParent(UIControl *parent_);
};
}

Expand Down
15 changes: 10 additions & 5 deletions src/UI/UIPanel.h
Expand Up @@ -15,23 +15,28 @@
#include "../ngine.h"

#include "../Math/Vector2.h"
#include "UIControl.h"

namespace NerdThings::Ngine::UI {
/*
* A UI panel, contains all controls
* A UI Panel base, contains entities
*/
class NEAPI UIPanel {
class NEAPI UIPanel : public UIControl {
// Private Fields

/*
* The panel type
* Panel children
*/
EUIPanelType _Type;

std::vector<UIControl *> _Children;
public:
// Public Constructor(s)

// Public Methods

/*
* Add a child to the panel
*/
void AddChild(UIControl *);
};
}

Expand Down
29 changes: 8 additions & 21 deletions src/ngine.h
Expand Up @@ -54,6 +54,7 @@
#include <algorithm> // Required for: std::clamp and alike methods
#include <chrono> // Required for: std::chrono timings
#include <map> // Required for: std::map
#include <stdexcept> // Required for: std::runtime_error
#include <string> // Required for: std::string
#include <thread> // Required for: std::this_thread sleep
#include <unordered_map> // Required for: std::unordered_map
Expand All @@ -68,6 +69,7 @@
#define NOGDI
#define NODRAWTEXT
#define NOUSER
#define NOCRYPT
#endif

//----------------------------------------------------------------------------------
Expand Down Expand Up @@ -121,10 +123,15 @@ namespace NerdThings::Ngine {
*/
HIDDEN_WINDOW = 128,

/*
* Continue running game when minimized
*/
ALWAYS_RUN_MINIMIZED = 256,

/*
* Whether or not to maintain the dimensions provided to the game constructor
*/
MAINTAIN_DIMENSIONS = 256
MAINTAIN_DIMENSIONS = 512
};

/*
Expand Down Expand Up @@ -475,26 +482,6 @@ namespace NerdThings::Ngine {
*/
WRAP_MIRROR_CLAMP
};

/*
* UI Panel Type
*/
enum EUIPanelType {
/*
* Display children horizontally
*/
TYPE_HORIZONTAL = 0,

/*
* Display children vertically
*/
TYPE_VERTICAL,

/*
* Display children in a grid
*/
TYPE_GRID
};
}

#endif // NGINE_H
32 changes: 11 additions & 21 deletions test/CMakeLists.txt
Expand Up @@ -23,35 +23,25 @@ set_target_properties(NgineTest
# Copy dependant dlls
if (${BUILD_SHARED})
if (WIN32)
if(MSVC AND NOT ${CMAKE_MAKE_PROGRAM} MATCHES "ninja.exe")
add_custom_command(TARGET NgineTest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_BINARY_DIR}/Ngine/$<CONFIG>/Ngine.dll"
"${CMAKE_BINARY_DIR}/NgineTest/$<CONFIG>/Ngine.dll")
add_custom_command(TARGET NgineTest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_BINARY_DIR}/Ngine/$<CONFIG>/raylib.dll"
"${CMAKE_BINARY_DIR}/NgineTest/$<CONFIG>/raylib.dll")
else()
add_custom_command(TARGET NgineTest POST_BUILD
add_custom_command(TARGET NgineTest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_BINARY_DIR}/Ngine/Ngine.dll"
"${CMAKE_BINARY_DIR}/NgineTest/Ngine.dll")
add_custom_command(TARGET NgineTest POST_BUILD
$<TARGET_FILE:Ngine>
$<TARGET_FILE_DIR:NgineTest>)

add_custom_command(TARGET NgineTest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_BINARY_DIR}/Ngine/raylib.dll"
"${CMAKE_BINARY_DIR}/NgineTest/raylib.dll")
endif()
$<TARGET_FILE:raylib>
$<TARGET_FILE_DIR:NgineTest>)
else()
add_custom_command(TARGET NgineTest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_BINARY_DIR}/Ngine/Ngine.so"
"${CMAKE_BINARY_DIR}/NgineTest/Ngine.so")
$<TARGET_FILE:Ngine>
$<TARGET_FILE_DIR:NgineTest>)

add_custom_command(TARGET NgineTest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_BINARY_DIR}/Ngine/raylib.so"
"${CMAKE_BINARY_DIR}/NgineTest/raylib.so")
$<TARGET_FILE:raylib_static>
$<TARGET_FILE_DIR:NgineTest>)
endif()
endif()

Expand Down

0 comments on commit 7a60e56

Please sign in to comment.