I did a project that helped me work out a development path to build C++ SDL2 applications for the clockwork gameshell, and then distribute them using the warehouse.
You can try out this extremely exciting hello world application by following these install instructions:
- Your gameshell must be online
- Enter the Warehouse application
- Choose the + Add new warehouse… option
- In the text editor, write
github.com/crolando/cwand then press the Y button
- with the new URL selected, press the A button to enter my warehouse.
- Choose the entry called SDL Example and press the A button
- Select the entry called hello_world and press the Y button to look at my application preview.
- Press the A button to download it (this is extremely subtle, you get very little feedback other than the text goes from gray to black)
- Press the A button to run it.
- A splash screen will be displayed, this is the hello world program.
- When you’re done, press the MENU button and it will return to the gameshell launcher
How did I make this?
My development pattern for this was pretty weird, but it is very simple to set up. I use WinSCP, the ftp program, to connect to the gameshell. I also have a PuTTY session connected to the gameShell. Using WinSCP, I can create a file using my windows computer directly on the gameshell, and edit it using NotePad++. This is kind awesomely friendly to do, because when you click “save” in notepad++, WinSCP will silently auto-upload it to the disk. It’s as if you’re just editing files on your windows hard drive. This is how I do my programming.
When I want to build the file, I switch to PuTTY, and I invoke the clang compiler to build the binary. Using WinSCP, I create a bash script that is set up to run the binary, and redirect the standard output and standard error streams to a file. This lets me print debug messages during a handheld run session to see where things are breaking.
To test the program, I pick up the gameshell, and use Utils > DinguxCommander. I navigate to my build area, and execute my script with the redirects. After the program executes, I can read the printed messages that were written into the log files using WinSCP. I also found it was occasionally useful to check the general error log to look for issues:
If you want to see my source file and the development script, they are included in the warehouse package, and will be put here after you run the program:
The main.cpp file has the clang commandline to build the hello world example as a comment. I don’t reccomend you do this in this folder, since it will desynchronize the binary from the github warehouse. If you want to play around with the program, copy it somewhere else first using winSCP, build it using PuTTY, and then run it using DinguxCommander.
After I did all of that development and cleaned up the comments and stuff, I used WinSCP to copy the script, binary and resources (like the BMP) to my windows computer. Here, I tar and gzipped the stuff, wrote the json files and then uploaded it to github. It took a few tries to get right, but it all works!