Skip to content

benanil/TemplateSaneProgram

Repository files navigation

Template Sane C++ Program

This is an engine for making applications and games for Android and Windows platforms.
I've tried to make this software as less as third party software possible.
Only used third party libraries are header only libraries such as stb.
I haven't used object orianted programming (maybe in feature),
code is written in a way that has: fast compile times and faster debug performance.
SDL, glfw or glm is not used so we have full control over software, ASTL used instead of C++ stl

Main file of the project is SaneProgram.cpp there are 4 functions in this file:
AXInit() -> runs before window initialization, you can set window name, position, size or VSync here.
AXStart() -> runs after initialization of opengl, you can import your assets here.
AXLoop() -> runs every frame you can add game logic and renderer code here.
AXExit() -> destroy everything before closing the engine.
PlatformAndroid.cpp or PlatformWindows.cpp will find and call these functions.
whithout these functions you will get error.

Here is how you can run test code:

to use with Visual Studio:

cmake . -Bbuild

after that you can build the project by running build.bat or built within Visual Studio.
you can also build with GCC or Clang, uncomment GCC or Clang lines in build.bat and run the script

Windowing

Template program supports windowing which means you can create window in windows and android platforms
it works like glfw and SDL, supports keyboard, mouse and touch input
to change the icon of the .exe and application information (CompanyName, Version, Product name)
edit info.rc and execute this command

windres SaneProgram.rc -O coff -o SaneProgram.res

To change icon and information of the .exe:
Visual Studio go to SolutionExplorer-> right click SaneProgram->AddExisting->SaneProgram.res

Be Aware

By default Engine Tries to start with Bistro Scene you have to download it from Google Drive Otherwise change to Sponza Scene from SaneProgram.cpp, it will work

Good to Know

'r' prefix used for renderer functions 'w' prefix used for windowing functions this is doom like thing

Building Android Project

You have to move Meshes and Shaders folders to TemplateSaneProgram\Android\app\src\main\assets folder
but you can use python script manually. This command below moves shaders meshes and texture files(astc)

python3 AndroidBuild.py move_assets

to build apk you can run the command below

python3 AndroidBuild.py build

to run the project on your phone you have to run this command below.
conntect your phone to your pc and make sure usb debugging is on

python3 AndroidBuild.py run 

or you can use Android Studio to build and run your project, just open Android Folder with Android studio

Other Info

Blender Mixamo Character Import Settings: Rotation quaternion: w:1.0, xyz: 0.0 Scale.xyz : 0.140, 0.140, 0.140 Transform.+yUp : uncheck

Blender Multi Animation: https://roderickvella.wordpress.com/2023/05/18/importing-mixamo-animations-into-raylib/

Used Libraries

for fbx scenes ufbx
importing, resizing, saving textures + importing font stb libraries
astc texture format codec for android textures astc-encoder
fast compression library by facebook zstandard
for dxt texture compression etcpak

Contributing

feel free to contribute

Contact

If you have any questions, feedback, or suggestions, feel free to reach out:

Email: anilcangulkaya7@gmail.com
Twitter: @anilcanglk12
GitHub: @benanil

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages