Submissions by haxpor tagged sdl2

Actually there's no need to modify cpp source file, but we still need to slightly modify header file very little bit.

Combined knowledge of C/C++ linkage to C++ library to produce C linkage so that C source file can call functions properly. Check symbol table dumped via objdump -t ....

As well the technique to directly use .dylib file to solve -l issue ("lib" prefix) is good.

Made progress and understand practices and techniques used in making cimgui on top of imgui.

imgui has several native implementations to use i.e. sdl2 with opengl2/3.

Anyway, right now still facing the issue of segmentation fault: 11 via gl3w, and Assertion failed "Invalid DisplaySize value" (via glew).

Add 27

27_collisionDetection/.gitignore
27_collisionDetection/LButton.c
27_collisionDetection/LButton.h
27_collisionDetection/LTexture.c
27_collisionDetection/LTexture.h
27_collisionDetection/LTimer.c
27_collisionDetection/LTimer.h
27_collisionDetection/Makefile
27_collisionDetection/collision.c
27_collisionDetection/common.c
27_collisionDetection/common.h
27_collisionDetection/dot.bmp

--
really did deep to sdl2 internal, and bunch of vim research.

Update template to render FPS at the top right corner

8bitwondor.ttf
template.c


Add 26

26_motion/LButton.c
26_motion/LButton.h
26_motion/LTexture.c
26_motion/LTexture.h
26_motion/LTimer.c
26_motion/LTimer.h
26_motion/Makefile
26_motion/README.md
26_motion/common.c
26_motion/common.h
26_motion/dot.bmp
26_motion/motion.c

--

Add script to quickly kickstart creating a new sample directory

README.md
createsample.sh

Add 25

A submission for Skillset Time 29

Add 25

25_cappingFramerate/.gitignore
25_cappingFramerate/LButton.c
25_cappingFramerate/LButton.h
25_cappingFramerate/LTexture.c
25_cappingFramerate/LTexture.h
25_cappingFramerate/LTimer.c
25_cappingFramerate/LTimer.h
25_cappingFramerate/Makefile
25_cappingFramerate/README.md
25_cappingFramerate/cframerate.c
25_cappingFramerate/common.c
25_cappingFramerate/common.h
25_cappingFramerate/lazy.ttf
25_cappingFramerate/template.c

Add 24

A submission for Skillset Time 28

Add 24

24_framerate/.gitignore
24_framerate/LButton.c
24_framerate/LButton.h
24_framerate/LTexture.c
24_framerate/LTexture.h
24_framerate/LTimer.c
24_framerate/LTimer.h
24_framerate/Makefile
24_framerate/README.md
24_framerate/common.c
24_framerate/common.h
24_framerate/framerate.c
24_framerate/lazy.ttf

Add 23

A submission for Skillset Time 27

Add 23

23_advancedTiming/.gitignore
23_advancedTiming/LButton.c
23_advancedTiming/LButton.h
23_advancedTiming/LTexture.c
23_advancedTiming/LTexture.h
23_advancedTiming/LTimer.c
23_advancedTiming/LTimer.h
23_advancedTiming/Makefile
23_advancedTiming/adv_timing.c
23_advancedTiming/common.c
23_advancedTiming/common.h
23_advancedTiming/lazy.ttf

Add 22

A submission for Skillset Time 26

Add 22

22_timing/.gitignore
22_timing/LButton.c
22_timing/LButton.h
22_timing/LTexture.c
22_timing/LTexture.h
22_timing/Makefile
22_timing/README.md
22_timing/common.c
22_timing/common.h
22_timing/lazy.ttf
22_timing/timing.c

Add 21. Removed unneeded README.md file from 18 and 20.

This sample also demonstrates how to do mroe complicated cross-compile
for libraries that also have dependencies namely SDL_image and
SDL_mixer.

18_keyStates/README.md
20_forcefeedback/README.md
21_sfxMusic/.gitignore
21_sfxMusic/LButton.c
21_sfxMusic/LButton.h
21_sfxMusic/LTexture.c
21_sfxMusic/LTexture.h
21_sfxMusic/Makefile
21_sfxMusic/README.md
21_sfxMusic/beat.wav
21_sfxMusic/bensound-ukulele.mp3
21_sfxMusic/bensound-ukulele.ogg
21_sfxMusic/common.c
21_sfxMusic/common.h
21_sfxMusic/high.wav
21_sfxMusic/libmpg123.dylib
21_sfxMusic/libvorbisfile.dylib
21_sfxMusic/low.wav
21_sfxMusic/medium.wav
21_sfxMusic/prompt.png
21_sfxMusic/scratch.wav
21_sfxMusic/sfxmusic.c
21_sfxMusic/sfxmusic.exe

--

Successfully tested cross-compile result on Windows 32 bit on top of VirtualBox, and on dev machine macOS. Works fine. But hardware acceleration support on virtualbox makes it slower to run.

This whole process uses mingw64 to build both 32 and 64 bit app.

Along the way, updated virtualbox (windows xp) to support 3d acceleration thus it will be able to run opengl app.

I asked my friend if he's willing to help me test on real windows machine to confirm.

PS. build against SDL 2.0.9

I now made progress on building on platforms I will be targeting, sorted accordingly to priority

PC
Android
iOS

The last one is the most difficult among others, I will write blog post about this on blog.wasin.io as well. Now, it's ok!

The screenshots are from rectangles.c sample.
First one from ios device, another from PC (for testing).

Add 20

With improved over setting NULL to freed variables in close() from 19.

20_forcefeedback/.gitignore
20_forcefeedback/LButton.c
20_forcefeedback/LButton.h
20_forcefeedback/LTexture.c
20_forcefeedback/LTexture.h
20_forcefeedback/Makefile
20_forcefeedback/README.md
20_forcefeedback/common.c
20_forcefeedback/common.h
20_forcefeedback/haptic.c
20_forcefeedback/splash.png

--
have to go back to use xcode 9.4 to build sdl2 on mojave to get rid of initial black screen on mojave.

Finish 19 with improved and spread into 2 sub-sample

2 sub-sample taking into account both joystick and game controller
sub-system. Each of both has subtle APIs to deal with in code.

19_gamepadsAndJoysticks/.gitignore
19_gamepadsAndJoysticks/LButton.c
19_gamepadsAndJoysticks/LButton.h
19_gamepadsAndJoysticks/LTexture.c
19_gamepadsAndJoysticks/LTexture.h
19_gamepadsAndJoysticks/Makefile
19_gamepadsAndJoysticks/README.md
19_gamepadsAndJoysticks/arrow.png
19_gamepadsAndJoysticks/common.c
19_gamepadsAndJoysticks/common.h
19_gamepadsAndJoysticks/controllers.c
19_gamepadsAndJoysticks/joysticks.c

Add tutorial 18

18_keyStates/LButton.c
18_keyStates/LButton.h
18_keyStates/LTexture.c
18_keyStates/LTexture.h
18_keyStates/LTexture.o
18_keyStates/Makefile
18_keyStates/README.md
18_keyStates/common.c
18_keyStates/common.h
18_keyStates/common.o
18_keyStates/down.png
18_keyStates/keystates.c
18_keyStates/keystates.o
18_keyStates/keystates.out
18_keyStates/left.png
18_keyStates/press.png
18_keyStates/right.png
18_keyStates/up.png

Now I'm at the point that learning more from lazyfoo's tutorial for enough time before going back to continue for sdl2-manpage is a better idea to grasp what necessary APIs to be used.

As well, finally complete sample 17 which is long overdue.

Add sample 17 with improved Makefile and added template.c source

17_mouseEvents/.gitignore
17_mouseEvents/LButton.c
17_mouseEvents/LButton.h
17_mouseEvents/LTexture.c
17_mouseEvents/LTexture.h
17_mouseEvents/Makefile
17_mouseEvents/README.md
17_mouseEvents/button.png
17_mouseEvents/common.c
17_mouseEvents/common.h
17_mouseEvents/mouseevents.c
17_mouseEvents/mouseevents.out
template.c

Made progress on Functions section

COVER.md
src/SDL_ClearError.3
src/SDL_ClearHints.3
src/SDL_ClearQueuedAudio.3
src/SDL_CloseAudio.3

Made more progress on Function section

COVER.md
src/SDL_AudioInit.3
src/SDL_AudioQuit.3
src/SDL_BlitScaled.3
src/SDL_BlitSurface.3
src/SDL_BuildAudioCVT.3
src/SDL_COMPILEDVERSION.3
src/SDL_CalculateGammaRamp.3
src/SDL_CaptureMouse.3

M COVER.md
M install.sh
M src/SDL_AddEventWatch.3
M src/SDL_AddHintCallback.3
M src/SDL_AddTimer.3
M src/SDL_AllocFormat.3
M src/SDL_AllocPalette.3
M src/SDL_AllocRW.3
M src/SDL_AndroidGetActivity.3
M src/SDL_AndroidGetExternalStoragePath.3
M src/SDL_AndroidGetExternalStorageState.3
M src/SDL_AndroidGetInternalStoragePath.3
M src/SDL_AndroidGetJNIEnv.3
D src/SDL_AtomicAdd.3
D src/SDL_AtomicCAS.3
D src/SDL_AtomicCASPtr.3
D src/SDL_AtomicDecRef.3
D src/SDL_AtomicGet.3
D src/SDL_AtomicGetPtr.3
D src/SDL_AtomicIncRef.3
D src/SDL_AtomicLock.3
D src/SDL_AtomicSet.3
D src/SDL_AtomicSetPtr.3
D src/SDL_AtomicTryLock.3
D src/SDL_AtomicUnlock.3
M src/SDL_FunctionTemplate

Finally make it works!

I use 15c ndk version. And slightly modified app/build.gradle to satisfy the build process (note about abiFilters for both debug and release target, I need to specify it then filter again in android domain to let it build all architectures in need) at https://gist.github.com/haxpor/7da795ef505ff65773dbd1af8a11e2d1

Result see attached image.

Make progress on Functions section

COVER.md
src/SDL_AndroidGetExternalStoragePath.3
src/SDL_AndroidGetExternalStorageState.3
src/SDL_AndroidGetInternalStoragePath.3
src/SDL_AndroidGetJNIEnv.3

--
Still didn't get NDK build working for Android-related functions.

Trying to get NDK build workflow for SDL2 works but not yet.

To test the sample code for SDL_AndroidGetActivity by building a real Android app via NDK. Still not work. Tried with several NDK versions without luck.

Made first progress on Functions section

COVER.md
src/SDL_AddEventWatch.3
src/SDL_AddHintCallback.3
src/SDL_AddTimer.3
src/SDL_AllocFormat.3
src/SDL_AllocPalette.3
src/SDL_AllocRW.3
src/SDL_AndroidGetActivity.3
src/SDL_FunctionTemplate

Started to gain benefit of previous sections which have been done in completing Functions section whenever I need to refer back to certain struct or don't know about certain references.

Complete structures section

COVER.md
src/SDL_SysWMEvent.3
src/SDL_SysWMInfo.3
src/SDL_SysWMmsg.3
src/SDL_TextEditingEvent.3
src/SDL_TextInputEvent.3
src/SDL_Texture.3
src/SDL_TouchFingerEvent.3
src/SDL_UserEvent.3
src/SDL_WindowEvent.3
src/SDL_assert_data.3
src/SDL_atomic_t.3
src/SDL_version.3

Loading more