2022-04-28 12:49:19 +02:00
|
|
|
# Simple DirectMedia Layer SDL 1.2.15 sources for Casio Graph 90+E and Prizm CG10/20
|
2022-04-28 12:39:32 +02:00
|
|
|
|
|
|
|
Need to have a fully working gcc toolchain for SH3/SH4 architecture.
|
|
|
|
|
2022-08-30 11:42:07 +02:00
|
|
|
You can use the `giteapc install Slyvtt/cSDL` command to get an automatic install
|
2022-04-28 12:39:32 +02:00
|
|
|
|
|
|
|
|
2022-08-30 11:42:07 +02:00
|
|
|
## Using in a program
|
2022-04-28 12:49:19 +02:00
|
|
|
|
2022-08-30 11:42:07 +02:00
|
|
|
With CMake
|
2022-04-28 12:49:19 +02:00
|
|
|
|
2022-08-30 11:42:07 +02:00
|
|
|
```cmake
|
|
|
|
find_package(cSDL 1.2.15 REQUIRED)
|
|
|
|
target_link_libraries(<TARGET> PRIVATE cSDL::cSDL)
|
|
|
|
```
|
2022-04-28 12:49:19 +02:00
|
|
|
|
2022-08-30 11:42:07 +02:00
|
|
|
With make, the following steps are not automatically done, so please proceed with the following manipulations :
|
|
|
|
* copy the library `libcSDL.a` into your SH3/SH4 compiler lib folder
|
|
|
|
* copy all header files `*.h` in the include folder `include/SDL` of the SH3/SH4 compiler
|
|
|
|
* link with `-lcSDL`
|
|
|
|
|
2022-08-31 20:59:59 +02:00
|
|
|
In the C/C++ sources `#include <SDL/SDL.h>`
|
2022-08-30 11:42:07 +02:00
|
|
|
|
|
|
|
|
2022-08-31 20:59:59 +02:00
|
|
|
## Typical CMakeLists.txt
|
|
|
|
|
|
|
|
Below is the typical minimum `CMakeLists.txt` file to be used for a fxSDK project aiming at using the cSDL library :
|
|
|
|
|
|
|
|
```cmake
|
|
|
|
cmake_minimum_required(VERSION 3.15)
|
|
|
|
project(MyAddin)
|
|
|
|
|
|
|
|
include(GenerateG3A)
|
|
|
|
include(Fxconv)
|
|
|
|
find_package(Gint 2.7.1 REQUIRED)
|
|
|
|
find_package(cSDL 1.2.15 REQUIRED)
|
|
|
|
|
|
|
|
set(SOURCES
|
|
|
|
src/main.c
|
|
|
|
# ...
|
|
|
|
)
|
|
|
|
# Shared assets, fx-9860G-only assets and fx-CG-50-only assets
|
|
|
|
set(ASSETS
|
|
|
|
# ...
|
|
|
|
)
|
|
|
|
|
|
|
|
set(ASSETS_cg
|
|
|
|
assets-cg/example.png
|
|
|
|
# ...
|
|
|
|
)
|
|
|
|
|
|
|
|
fxconv_declare_assets(${ASSETS} ${ASSETS_cg} WITH_METADATA)
|
|
|
|
|
|
|
|
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}})
|
|
|
|
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os)
|
|
|
|
target_link_libraries(myaddin Gint::Gint cSDL::cSDL)
|
|
|
|
|
|
|
|
if("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
|
|
|
|
generate_g3a(TARGET myaddin OUTPUT "SDL_App.g3a"
|
|
|
|
NAME "SDL_App" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
|
|
|
|
endif()
|
|
|
|
```
|
2022-04-28 12:49:19 +02:00
|
|
|
|