A simple open source game library written in C++ that emulates some of the limitations of Sony's PlayStation 1.
- No external dependencies (all required libraries are bundled into palmx)
- Cross-Platform compatibility (Windows, Linux)
- Streamlined font/sprite/model rendering
- Authentic pixelated resolution (native 320x240 downscaling)
- Polygon jittering
- Texture warping (example)
Examples can be found in the Examples folder.
A basic example on how to create a window looks like this:
#include <palmx.h>
using namespace palmx;
int main() // Program Entry Point
{
Init("hello world", 800, 600); // Create window and OpenGL context
Camera camera; // A camera is always required for rendering
SetBackground(color_skyblue);
// Main game loop
while(!IsExitRequested())
{
CollectInput(); // Gather input
// TODO Update variables
BeginDrawing(camera); // Setup render texture
// TODO Draw Models/Sprites/Text
EndDrawing(); // Swap buffers
}
Exit(); // Close window and OpenGL context
return 0;
}
A step by step guide on how to integrate palmx into your game project using CMake.
# Clone the palmx repository into your dependency folder (e.g. external).
$ git clone https://github.com/getmyisland/palmx.git
# Navigate into the palmx folder
$ cd palmx
# Initialize submodules
$ git submodule update --init --recursive
Create a CMakeLists.txt
in the root of your project.
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
project(your_project)
# (OPTIONAL) Disable palmx example builds
set(PALMX_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
# Add palmx as a subdirectory
add_subdirectory(palmx)
# Add your game's source files
add_executable(your_project main.cpp)
# Link against the palmx library
target_link_libraries(your_project
PRIVATE
palmx
)
# Include the header directory
target_include_directories(your_project
PRIVATE
${PALMX_SOURCE_DIR}/include
)
Create a main.cpp
file in the root of your project and copy-paste the example window code from above.
Open a command line in the root of your project:
# Generate build files and folder
$ cmake -B build
# Build the game
$ cmake --build build
- OpenGL - Graphics Library
- CMake - Build Tool
- GLFW - Window Management
- GLM - Mathematics Library
- assimp - 3D Model Loading
- FreeType - Font Loading
- stb_image - Texture Loading
This project is licensed under the MIT License - see the LICENSE.md file for details