Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AxorusMT committed Feb 4, 2023
0 parents commit 00a310c
Show file tree
Hide file tree
Showing 4 changed files with 179 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.vscode
/AxonEngine.make
/Makefile
/build
Binary file added premake5
Binary file not shown.
125 changes: 125 additions & 0 deletions premake5.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@


workspace "Axon"
configurations {
-- standard debug config, all symbols on
"Debug64",
-- release config, optimised for binary size
"ReleaseSize64",
-- release config, optimised for binary speed
"ReleaseSpeed64",
-- release config, with all optimisations turned on
"Release64",

-- 32-bit opposites (probably won't be used much, if at all)

"Debug32",
"ReleaseSize32",
"ReleaseSpeed32",
"Release32"
}

project "AxonEngine"
-- Make this a library eventually
kind "WindowedApp"
language "C++"
-- Using C++20, for concepts
cppdialect "C++20"

targetdir "build/bin/%{cfg.buildcfg}"
objdir "build/obj/%{cfg.buildcfg}"

files {
"src/**.cpp",
"include/**.h"
}

includedirs "include"
links {
"SDL2",
"SDL2_image"
}


-- 32 Bit arch
filter "configurations:*32"
architecture "x86"


filter "configurations:Debug32"
defines {
"AXON_DEBUG",
"AXON_32"
}
symbols "On"
optimize "Off"

filter "configurations:ReleaseSize32"
defines {
"AXON_RELEASE_SIZE",
"AXON_32"
}
symbols "Off"
optimize "Size"

filter "configurations:ReleaseSpeed32"
defines {
"AXON_RELEASE_SPEED",
"AXON_32"
}
symbols "Off"
optimize "Speed"

filter "configurations:Release32"
defines {
"AXON_RELEASE",
"AXON_32"
}
symbols "Off"
optimize "Full"

-- 64 Bit arch
filter "configurations:*64"
architecture "x86_64"

filter "configurations:Debug64"
defines {"AXON_DEBUG", "AXON_64"}
symbols "On"
optimize "Off"

filter "configurations:ReleaseSize64"
defines {
"AXON_RELEASE_SIZE",
"AXON_64"
}
symbols "Off"
optimize "Size"

filter "configurations:ReleaseSpeed64"
defines {
"AXON_RELEASE_SPEED",
"AXON_64"
}
symbols "Off"
optimize "Speed"

filter "configurations:Release64"
defines {
"AXON_RELEASE",
"AXON_64"
}
symbols "Off"
optimize "Full"


filter {"action:gmake*", "system:linux"}
-- Warnings
buildoptions {
"-Wall",
"-Wpedantic",
"-Wextra"
}




50 changes: 50 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#include <iostream>
#include <SDL2/SDL.h>
#include <string>

std::string getTitle() {
std::string title = "AxonEngine [";

#ifdef AXON_DEBUG
title.append("Debug, ");
#else
title.append("Release, ");
#endif

#ifdef AXON_64
title.append("64-Bit]");
#else
title.append("32-Bit]");
#endif

return title;
}

int main(int argc, const char* argv[]) {

SDL_Init(SDL_INIT_VIDEO);
SDL_Window* window;

window = SDL_CreateWindow(
getTitle().c_str(),
SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED,
1280,
720,
SDL_WINDOW_SHOWN
);

if (window == nullptr) {
std::cout << "Failure to create window: \n " << SDL_GetError() << std::endl;
SDL_Quit();
return -1;
}

SDL_Delay(5000);

SDL_DestroyWindow(window);

SDL_Quit();

return 0;
}

0 comments on commit 00a310c

Please sign in to comment.