[glfw] renderer_draw_lite -> renderer_draw_c

This commit is contained in:
Mario Zechner 2025-08-27 13:00:45 +02:00
parent b34a0b33f8
commit 8118d7ff55
6 changed files with 12 additions and 35 deletions

View File

@ -50,7 +50,7 @@ target_link_libraries(your_target PRIVATE spine-cpp)
- [spine-glfw](../spine-glfw) - [spine-glfw](../spine-glfw)
- [spine-sdl](../spine-sdl) - [spine-sdl](../spine-sdl)
- [spine-sfml](../spine-sfml/cpp) - [spine-sfml](../spine-sfml/cpp)
- [spine-cocos2dx](../spine-cocos2dx) - [spine-godot](../spine-godot)
- [spine-ue](../spine-ue) - [spine-ue](../spine-ue)
- [spine-flutter (via spine-c & FFI)](../spine-flutter) - [spine-flutter (via spine-c & FFI)](../spine-flutter)
- [spine-ios (via spine-c & FFI)](../spine-ios) - [spine-ios (via spine-c & FFI)](../spine-ios)

View File

@ -60,29 +60,12 @@ The repository includes example code for both C and C++ APIs:
- C example: [example/main-c.cpp](example/main-c.cpp) - C example: [example/main-c.cpp](example/main-c.cpp)
- C++ example: [example/main.cpp](example/main.cpp) - C++ example: [example/main.cpp](example/main.cpp)
### Building the Examples
The project includes a `build.sh` script for easy building:
```bash
cd spine-glfw
./build.sh # Build debug version
./build.sh release # Build release version
./build.sh clean # Clean and rebuild
```
### Windows ### Windows
1. Install [Visual Studio Community](https://visualstudio.microsoft.com/downloads/) with C++ support and Windows SDK. 1. Install [Visual Studio Community](https://visualstudio.microsoft.com/downloads/). Make sure you install support for C++ and CMake.
2. Install [CMake](https://cmake.org/download/) via the Windows installer package. 2. Download the Spine Runtimes repository using git (`git clone https://github.com/esotericsoftware/spine-runtimes`) or download it as a zip.
3. Clone the repository: `git clone https://github.com/esotericsoftware/spine-runtimes` 3. Open Visual Studio Community, then open `spine-glfw/` via the **Open a local folder** button in the Visual Studio Community launcher.
4. Run CMake GUI from the start menu 4. Wait for CMake to finish, then select either `spine-glfw-example.exe` or `spine-glfw-example-c.exe` as the start-up project and start debugging.
5. Set source directory to `spine-runtimes/spine-glfw`
6. Set build directory to `spine-runtimes/spine-glfw/build`
7. Click `Configure`, then `Generate`
8. Open the generated solution in Visual Studio
9. Set `spine-glfw-example` or `spine-glfw-example-c` as the startup project
10. Run the project
### Linux ### Linux

View File

@ -143,7 +143,7 @@ int main() {
gl::glClear(gl::GL_COLOR_BUFFER_BIT); gl::glClear(gl::GL_COLOR_BUFFER_BIT);
// Render the skeleton in its current pose // Render the skeleton in its current pose
renderer_draw_lite(renderer, skeleton, true); renderer_draw_c(renderer, skeleton, true);
// Present the rendering results and poll for events // Present the rendering results and poll for events
glfwSwapBuffers(window); glfwSwapBuffers(window);

View File

@ -315,7 +315,7 @@ void renderer_set_viewport_size(renderer_t *renderer, int width, int height) {
shader_set_matrix4(renderer->shader, "uMatrix", matrix); shader_set_matrix4(renderer->shader, "uMatrix", matrix);
} }
void renderer_draw_lite(renderer_t *renderer, spine_skeleton skeleton, bool premultipliedAlpha) { void renderer_draw_c(renderer_t *renderer, spine_skeleton skeleton, bool premultipliedAlpha) {
renderer_draw(renderer, (Skeleton *) skeleton, premultipliedAlpha); renderer_draw(renderer, (Skeleton *) skeleton, premultipliedAlpha);
} }

View File

@ -118,7 +118,7 @@ void renderer_draw(renderer_t *renderer, spine::Skeleton *skeleton, bool premult
/// Draws the given skeleton. The atlas must be the atlas from which the drawable /// Draws the given skeleton. The atlas must be the atlas from which the drawable
/// was constructed. /// was constructed.
void renderer_draw_lite(renderer_t *renderer, spine_skeleton skeleton, bool premultipliedAlpha); void renderer_draw_c(renderer_t *renderer, spine_skeleton skeleton, bool premultipliedAlpha);
/// Disposes the renderer /// Disposes the renderer
void renderer_dispose(renderer_t *renderer); void renderer_dispose(renderer_t *renderer);

View File

@ -68,16 +68,10 @@ The repository includes example code for both C and C++ APIs:
### Windows ### Windows
1. Install [Visual Studio Community](https://visualstudio.microsoft.com/downloads/) with C++ support and Windows SDK. 1. Install [Visual Studio Community](https://visualstudio.microsoft.com/downloads/). Make sure you install support for C++ and CMake.
2. Install [CMake](https://cmake.org/download/) via the Windows installer package. 2. Download the Spine Runtimes repository using git (`git clone https://github.com/esotericsoftware/spine-runtimes`) or download it as a zip.
3. Clone the repository: `git clone https://github.com/esotericsoftware/spine-runtimes` 3. Open Visual Studio Community, then open `spine-sdl/` via the **Open a local folder** button in the Visual Studio Community launcher.
4. Run CMake GUI from the start menu 4. Wait for CMake to finish, then select either `spine-sdl-c-example.exe` or `spine-sdl-cpp-example.exe` as the start-up project and start debugging.
5. Set source directory to `spine-runtimes/spine-sdl`
6. Set build directory to `spine-runtimes/spine-sdl/build`
7. Click `Configure`, then `Generate`
8. Open the generated solution in Visual Studio
9. Set `spine-sdl-c-example` or `spine-sdl-cpp-example` as the startup project
10. Run the project
### Linux ### Linux