Adding glfw window

dev
anulax1225 ago%!(EXTRA string=1 year)
parent 7bf42ea4b1
commit 99b3cb618e
  1. 13
      bakara/premake5.lua
  2. 11
      bakara/src/bakara/core/application.cpp
  3. 3
      bakara/src/bakara/core/application.h
  4. 1
      bakara/src/bakara/plaforms/window/glfw/win_glfw.cpp
  5. 1
      bakara/src/bakara/plaforms/window/glfw/win_glfw.h
  6. 78
      bakara/vendor/premake5.lua
  7. 2
      premake5.lua
  8. 3
      sandbox/premake5.lua
  9. 1
      sandbox/src/sandbox.cpp

@ -13,6 +13,12 @@ project "bakara"
"GLFW_INCLUDE_NONE"
}
buildoptions
{
"-lglfw",
"-lGL"
}
files
{
"src/**.h",
@ -22,15 +28,16 @@ project "bakara"
includedirs
{
"%{IncludeDirs.bakara}",
"%{IncludeDirs.glfw}",
"%{IncludeDirs.glm}",
"%{IncludeDirs.spdlog}",
"%{IncludeDirs.glfw}"
"%{IncludeDirs.spdlog}"
}
links
{
"GLFW",
"opengl32.lib",
"glm",
"glfw"
}
filter "configurations:Debug"

@ -1,11 +1,18 @@
#include "application.h"
namespace Bk {
Application::Application() { }
Application::Application()
{
p_window = Window::create_window();
}
Application::~Application() { }
void Application::run()
{
while (true);
while (p_running)
{
p_window->on_update();
}
}
}

@ -11,6 +11,9 @@ namespace Bk {
virtual ~Application();
void run();
private:
std::unique_ptr<Window> p_window;
bool p_running = true;
};
std::unique_ptr<Application> create_app();

@ -1,4 +1,5 @@
#include "win_glfw.h"
namespace Bk {
std::unique_ptr<Window> Window::create_window(const WindowPros& props)
{

@ -3,6 +3,7 @@
#include <bakara/core/window.h>
#include <GLFW/glfw3.h>
namespace Bk::Plaform {
class WinGLFW : public Window
{

@ -1,34 +1,4 @@
project "glm"
location "./glm/glm"
kind "StaticLib"
language "C++"
cppdialect "C++17"
staticruntime "off"
targetdir("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}")
objdir("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}")
files
{
"%{prj.location}/**.hpp",
"%{prj.location}/**.inl",
"%{prj.location}/**.cpp"
}
includedirs
{
"%{IncludeDirs.glm}"
}
filter "configurations:Debug"
runtime "Debug"
symbols "on"
filter "configurations:Release"
runtime "Release"
optimize "on"
project "glfw"
project "GLFW"
location "./glfw"
kind "StaticLib"
language "C"
@ -36,17 +6,24 @@ project "glfw"
targetdir ("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}")
objdir ("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}")
includedirs { "%{prj.location}/include" }
files
{
"%{prj.location}/include/GLFW/glfw3.h",
"%{prj.location}/include/GLFW/glfw3native.h",
"%{prj.location}/src/glfw_config.h",
"%{prj.location}/include/GLFW/glfw3native.h",
"%{prj.location}/include/GLFW/glfw3.h",
"%{prj.location}/src/context.c",
"%{prj.location}/src/init.c",
"%{prj.location}/src/input.c",
"%{prj.location}/src/monitor.c",
"%{prj.location}/src/vulkan.c",
"%{prj.location}/src/window.c"
"%{prj.location}/src/window.c",
"%{prj.location}/src/platform.c",
"%{prj.location}/src/null_init.c",
"%{prj.location}/src/null_monitor.c",
"%{prj.location}/src/null_window.c",
"%{prj.location}/src/null_joystick.c",
}
filter "system:linux"
@ -103,4 +80,35 @@ project "glfw"
filter "configurations:Release"
runtime "Release"
optimize "on"
optimize "on"
project "glm"
location "./glm/glm"
kind "StaticLib"
language "C++"
cppdialect "C++17"
staticruntime "off"
targetdir("%{wks.location}/bin/" .. outputdir .. "/%{prj.name}")
objdir("%{wks.location}/bin-int/" .. outputdir .. "/%{prj.name}")
files
{
"%{prj.location}/**.hpp",
"%{prj.location}/**.inl",
"%{prj.location}/**.cpp"
}
includedirs
{
"%{IncludeDirs.glm}"
}
filter "configurations:Debug"
runtime "Debug"
symbols "on"
filter "configurations:Release"
runtime "Release"
optimize "on"

@ -8,6 +8,8 @@ workspace "Bakara"
"MultiProcessorCompile"
}
linkgroups "On"
outputdir = "%{cfg.system}-%{cfg.architecture}-%{cfg.buildcfg}"
IncludeDirs = {}

@ -17,7 +17,8 @@ project "sandbox"
{
"%{IncludeDirs.bakara}",
"%{IncludeDirs.spdlog}",
"%{IncludeDirs.glm}"
"%{IncludeDirs.glm}",
""
}
links

@ -3,6 +3,7 @@
#include <utility>
#include <bakara.h>
class Sandbox : public Bk::Application
{
public:

Loading…
Cancel
Save