Initial commit

This commit is contained in:
JackCarterSmith 2024-09-13 18:05:15 +02:00
commit c88fa0617b
Signed by: JackCarterSmith
GPG Key ID: 832E52F4E23F8F24
6 changed files with 197 additions and 0 deletions

65
.gitignore vendored Normal file
View File

@ -0,0 +1,65 @@
# ---> C++
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# ---> CMake
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
# ---> VisualStudioCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
.cmake/
.vsconan/
# Local History for Visual Studio Code
.history/
# Built Visual Studio Code Extensions
*.vsix
build/
CMakeUserPresets.json

35
CMakeLists.txt Normal file
View File

@ -0,0 +1,35 @@
# CMakeLists.txt
# Written by JackCarterSmith, 2024
# This file is released under the ProtoTank license.
cmake_minimum_required(VERSION 3.23)
cmake_policy(VERSION 3.23)
# define project
project(ProtoTank VERSION 0.1.0 DESCRIPTION "Arcade 80s-style game with tanks" LANGUAGES C;CXX)
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h @ONLY)
include(FindPkgConfig)
include(CheckIncludeFile)
include(CheckCSourceCompiles)
# Find libraries
find_package(SFML REQUIRED)
include_directories(sfml::sfml)
# define src/headers files
FILE(GLOB AST_SCRS ./*.cpp)
FILE(GLOB AST_HRDS ./*.h)
SOURCE_GROUP("Source Files" FILES ${AST_SCRS})
SOURCE_GROUP("Header Files" FILES ${AST_HRDS})
# targets declarations
add_executable(${PROJECT_NAME} ${AST_SCRS} ${AST_HRDS})
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME ${PROJECT_NAME}-v${PROJECT_VERSION})
if(MSVC)
# msvc does not append 'lib' - do it here to have consistent name
set_target_properties(AST PROPERTIES IMPORT_PREFIX "lib")
endif()
target_link_libraries(${PROJECT_NAME} sfml::sfml)

9
LICENSE Normal file
View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) 2024 JCS-Prod
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 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.

30
ProtoTank.cpp Normal file
View File

@ -0,0 +1,30 @@
#include <iostream>
#include <stdexcept>
#include <SFML/Graphics.hpp>
#ifdef __AVX2__
#endif
int main(int argc, char** argv) {
sf::RenderWindow window(sf::VideoMode(480, 240), "ProtoTank");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return EXIT_SUCCESS;
}

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# ProtoTank
A quick concept of a 80s arcade game with tanks

55
conanfile.py Normal file
View File

@ -0,0 +1,55 @@
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain#,cmake_layout
from conan.tools.files import copy
required_conan_version = ">=1.59"
class ProtoTank(ConanFile):
name = "ProtoTank"
version = "0.1"
description = """Demo/PoC project
Arcade 80s-style game with tanks"""
license = "MIT"
author = "JackCarterSmith (j@jcsmith.fr)"
url = "https://git.jcsmith.fr/JCS-Prod/ProtoTank"
package_type = "application"
revision_mode = "scm"
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeDeps"
def configure(self):
self.options["sfml"].audio = True
self.options["sfml"].window = True
self.options["sfml"].network = False
self.options["sfml"].graphics = True
if self.settings.os == "Linux":
self.options["sfml"].shared = False
self.options["sfml"].fPIC = True
if self.settings.os == "Windows":
self.options["sfml"].shared = True
def requirements(self):
self.requires("sfml/2.6.1")
# def layout(self):
# cmake_layout(self)
def generate(self):
tc = CMakeToolchain(self)
#tc.user_presets_path = False
tc.generate()
for dep in self.dependencies.values():
if self.settings.os == "Windows" and len(dep.cpp_info.bindirs) > 0:
copy(self, "*.dll", dep.cpp_info.bindirs[0], self.build_folder)
# def package(self):
# copy(self, "LICENSE", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses"))
# copy(self, pattern="*.h", src=os.path.join(self.source_folder, "include"), dst=os.path.join(self.package_folder, "include"))
# copy(self, pattern="*.a", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False)
# copy(self, pattern="*.so", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False)
# copy(self, pattern="*.lib", src=self.build_folder, dst=os.path.join(self.package_folder, "lib"), keep_path=False)
# copy(self, pattern="*.dll", src=self.build_folder, dst=os.path.join(self.package_folder, "bin"), keep_path=False)