Skip to content

Commit

Permalink
v0.1 circle collision
Browse files Browse the repository at this point in the history
  • Loading branch information
YuriSizuku committed Mar 31, 2021
1 parent 07bdf22 commit acf7b62
Show file tree
Hide file tree
Showing 10 changed files with 930 additions and 33 deletions.
39 changes: 33 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,45 @@ endfunction()

message("This is a simple sdl framework demo")
set(CMAKE_CXX_STANDARD 11)
set(DEMO_NAME demo)
add_executable(${DEMO_NAME}
src/demo.cpp
set(SDL_FRAMEWORK_CODE
src/sdl_util.h
src/sdl_util.c
src/sdl_framework.hpp
src/sdl_framework.cpp
src/sdl_object2d.hpp
src/sdl_object2d.cpp
src/sdl_object2d.cpp)
set(GL_FRAMEWORK_CODE
src/gl_util.h
src/gl_util.c
src/gl_object3d.hpp
src/gl_object3d.cpp
)
src/gl_object3d.cpp)

# simple circle
set(DEMO_NAME circle_one)
add_executable(${DEMO_NAME}
src/example/${DEMO_NAME}.cpp
${SDL_FRAMEWORK_CODE}
${GL_FRAMEWORK_CODE})
target_include_directories(${DEMO_NAME} PRIVATE
${PROJECT_SOURCE_DIR}/src)
config_externlib(${DEMO_NAME})

# circle collision
set(DEMO_NAME circle_collision)
add_executable(${DEMO_NAME}
src/example/${DEMO_NAME}.cpp
${SDL_FRAMEWORK_CODE}
${GL_FRAMEWORK_CODE})
target_include_directories(${DEMO_NAME} PRIVATE
${PROJECT_SOURCE_DIR}/src)
config_externlib(${DEMO_NAME})

# danmaku
set(DEMO_NAME circle_danmaku)
add_executable(${DEMO_NAME}
src/example/${DEMO_NAME}.cpp
${SDL_FRAMEWORK_CODE}
${GL_FRAMEWORK_CODE})
target_include_directories(${DEMO_NAME} PRIVATE
${PROJECT_SOURCE_DIR}/src)
config_externlib(${DEMO_NAME})
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
# SdlFramework
My simple SDL framework for rendering and event handling
My simple SDL framework for rendering, updating and event handling.

There are some of the demos I made from this small framework.

## circle collision

A simulator for Perfect Elastic Collision, by conservation of momentum and energy.

![circle_collision](screenshot/circle_collision.gif)
Binary file added screenshot/circle_collision.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit acf7b62

Please sign in to comment.