this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove support for `sokol`. (#2662)

authored by

Alice and committed by
GitHub
2bffe82e aa1e0d5f

+1 -1078
-2
.gitignore
··· 149 149 build/vendor/sdl2/sdl2.pc 150 150 build/bin/bin2txt 151 151 build/bin/sdl-renderer 152 - build/bin/sokol-renderer 153 152 build/bin/tic80 154 - build/bin/tic80-sokol 155 153 out/ 156 154 build/bin/ 157 155 build/vendor/curl/libcurl.pc
-4
.gitmodules
··· 23 23 url = https://github.com/aliceisjustplaying/sdl-gpu.git 24 24 shallow = true 25 25 branch = glew-update 26 - [submodule "vendor/sokol"] 27 - path = vendor/sokol 28 - url = https://github.com/floooh/sokol.git 29 - shallow = true 30 26 [submodule "vendor/squirrel"] 31 27 path = vendor/squirrel 32 28 url = https://github.com/albertodemichelis/squirrel.git
-2
CMakeLists.txt
··· 29 29 option(BUILD_WITH_ALL "Build all supported scripts" ${BUILD_WITH_ALL_DEFAULT}) 30 30 option(BUILD_SDL "SDL Enabled" ON) 31 31 option(BUILD_SDLGPU "SDL GPU Enabled" OFF) 32 - option(BUILD_SOKOL "Sokol Enabled" OFF) 33 32 option(BUILD_LIBRETRO "libretro Enabled" ${BUILD_LIBRETRO_DEFAULT}) 34 33 option(BUILD_TOOLS "bin2txt prj2cart" OFF) 35 34 option(BUILD_EDITORS "Build cart editors" ON) ··· 158 157 include(cmake/studio.cmake) 159 158 160 159 include(cmake/sdl.cmake) 161 - include(cmake/sokol.cmake) 162 160 include(cmake/libretro.cmake) 163 161 include(cmake/n3ds.cmake) 164 162
-30
build/macosx/tic80-sokol.plist.in
··· 1 - <?xml version="1.0" encoding="UTF-8"?> 2 - <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 3 - <plist version="1.0"> 4 - <dict> 5 - <key>CFBundleDevelopmentRegion</key> 6 - <string>en</string> 7 - <key>CFBundleDisplayName</key> 8 - <string>TIC-80 Sokol</string> 9 - <key>CFBundleExecutable</key> 10 - <string>tic80-sokol</string> 11 - <key>CFBundleIconFile</key> 12 - <string>tic80.icns</string> 13 - <key>CFBundleIdentifier</key> 14 - <string>com.nesbox.tic</string> 15 - <key>CFBundleInfoDictionaryVersion</key> 16 - <string>6.0</string> 17 - <key>CFBundleName</key> 18 - <string>TIC-80 Sokol</string> 19 - <key>CFBundlePackageType</key> 20 - <string>APPL</string> 21 - <key>CFBundleShortVersionString</key> 22 - <string>@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_REVISION@</string> 23 - <key>CFBundleVersion</key> 24 - <string>@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_REVISION@</string> 25 - <key>NSHumanReadableCopyright</key> 26 - <string>https://tic80.com © 2017-@VERSION_YEAR@</string> 27 - <key>NSHighResolutionCapable</key> 28 - <true/> 29 - </dict> 30 - </plist>
-30
build/macosx/tic80pro-sokol.plist.in
··· 1 - <?xml version="1.0" encoding="UTF-8"?> 2 - <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 3 - <plist version="1.0"> 4 - <dict> 5 - <key>CFBundleDevelopmentRegion</key> 6 - <string>en</string> 7 - <key>CFBundleDisplayName</key> 8 - <string>TIC-80 Pro Sokol</string> 9 - <key>CFBundleExecutable</key> 10 - <string>tic80pro-sokol</string> 11 - <key>CFBundleIconFile</key> 12 - <string>tic80.icns</string> 13 - <key>CFBundleIdentifier</key> 14 - <string>com.nesbox.tic</string> 15 - <key>CFBundleInfoDictionaryVersion</key> 16 - <string>6.0</string> 17 - <key>CFBundleName</key> 18 - <string>TIC-80 Pro Sokol</string> 19 - <key>CFBundlePackageType</key> 20 - <string>APPL</string> 21 - <key>CFBundleShortVersionString</key> 22 - <string>@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_REVISION@</string> 23 - <key>CFBundleVersion</key> 24 - <string>@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_REVISION@</string> 25 - <key>NSHumanReadableCopyright</key> 26 - <string>https://tic80.com © 2017-@VERSION_YEAR@</string> 27 - <key>NSHighResolutionCapable</key> 28 - <true/> 29 - </dict> 30 - </plist>
-100
cmake/sokol.cmake
··· 1 - ################################ 2 - # Sokol 3 - ################################ 4 - 5 - if(BUILD_SOKOL) 6 - set(SOKOL_LIB_SRC ${CMAKE_SOURCE_DIR}/src/system/sokol/sokol_gfx.c) 7 - 8 - if(APPLE) 9 - set(SOKOL_LIB_SRC ${SOKOL_LIB_SRC} ${CMAKE_SOURCE_DIR}/src/system/sokol/sokol_impl.m) 10 - else() 11 - set(SOKOL_LIB_SRC ${SOKOL_LIB_SRC} ${CMAKE_SOURCE_DIR}/src/system/sokol/sokol_impl.c) 12 - endif() 13 - 14 - add_library(sokol STATIC ${SOKOL_LIB_SRC}) 15 - 16 - if(APPLE) 17 - target_compile_definitions(sokol PRIVATE SOKOL_METAL) 18 - elseif(WIN32) 19 - target_compile_definitions(sokol PRIVATE SOKOL_D3D11 SOKOL_D3D11_SHADER_COMPILER) 20 - elseif(LINUX) 21 - target_compile_definitions(sokol PRIVATE SOKOL_GLCORE33) 22 - endif() 23 - 24 - if(APPLE) 25 - set_property (TARGET sokol APPEND_STRING PROPERTY 26 - COMPILE_FLAGS "-fobjc-arc") 27 - 28 - target_link_libraries(sokol 29 - "-framework Cocoa" 30 - "-framework QuartzCore" 31 - "-framework Metal" 32 - "-framework MetalKit" 33 - "-framework AudioToolbox" 34 - ) 35 - elseif(WIN32) 36 - target_link_libraries(sokol D3D11) 37 - 38 - if(MINGW) 39 - target_link_libraries(sokol D3dcompiler_47) 40 - endif() 41 - elseif(LINUX) 42 - find_package (Threads) 43 - target_link_libraries(sokol X11 GL m dl asound ${CMAKE_THREAD_LIBS_INIT}) 44 - endif() 45 - 46 - target_include_directories(sokol PRIVATE ${THIRDPARTY_DIR}/sokol) 47 - endif() 48 - 49 - ################################ 50 - # Sokol standalone cart player 51 - ################################ 52 - 53 - if(BUILD_PLAYER AND BUILD_SOKOL) 54 - 55 - add_executable(player-sokol WIN32 ${CMAKE_SOURCE_DIR}/src/system/sokol/player.c) 56 - 57 - if(MINGW) 58 - target_link_libraries(player-sokol mingw32) 59 - target_link_options(player-sokol PRIVATE -static) 60 - endif() 61 - 62 - target_include_directories(player-sokol PRIVATE 63 - ${CMAKE_SOURCE_DIR}/include 64 - ${THIRDPARTY_DIR}/sokol 65 - ${CMAKE_SOURCE_DIR}/src) 66 - 67 - target_link_libraries(player-sokol tic80core sokol) 68 - endif() 69 - 70 - ################################ 71 - # TIC-80 app (Sokol) 72 - ################################ 73 - 74 - if(BUILD_SOKOL) 75 - 76 - set(TIC80_SRC ${CMAKE_SOURCE_DIR}/src/system/sokol/sokol.c) 77 - 78 - if(WIN32) 79 - 80 - configure_file("${PROJECT_SOURCE_DIR}/build/windows/tic80.rc.in" "${PROJECT_SOURCE_DIR}/build/windows/tic80.rc") 81 - set(TIC80_SRC ${TIC80_SRC} "${PROJECT_SOURCE_DIR}/build/windows/tic80.rc") 82 - 83 - add_executable(tic80-sokol WIN32 ${TIC80_SRC}) 84 - else() 85 - add_executable(tic80-sokol ${TIC80_SRC}) 86 - endif() 87 - 88 - target_include_directories(tic80-sokol PRIVATE 89 - ${CMAKE_SOURCE_DIR}/include 90 - ${CMAKE_SOURCE_DIR}/src 91 - ${THIRDPARTY_DIR}/sokol) 92 - 93 - if(MINGW) 94 - target_link_libraries(tic80-sokol mingw32) 95 - target_link_options(tic80-sokol PRIVATE -static -mconsole) 96 - endif() 97 - 98 - target_link_libraries(tic80-sokol tic80studio sokol) 99 - 100 - endif()
+1 -1
src/system/libretro/README.md
··· 11 11 cd TIC-80 12 12 git submodule update --init --recursive 13 13 cd build 14 - cmake .. -DBUILD_PLAYER=OFF -DBUILD_SOKOL=OFF -DBUILD_SDL=OFF -DBUILD_TOOLS=OFF -DBUILD_LIBRETRO=ON 14 + cmake .. -DBUILD_PLAYER=OFF -DBUILD_SDL=OFF -DBUILD_TOOLS=OFF -DBUILD_LIBRETRO=ON 15 15 make 16 16 ``` 17 17
-137
src/system/sokol/player.c
··· 1 - #include "system/sokol/sokol.h" 2 - 3 - #include <stdio.h> 4 - #include <stdlib.h> 5 - #include <string.h> 6 - #include <limits.h> 7 - 8 - #include <tic80.h> 9 - 10 - #define TIC80_WINDOW_TITLE "TIC-80" 11 - #define TIC80_DEFAULT_CART "cart.tic" 12 - 13 - static u64 tic_sys_counter_get() 14 - { 15 - return stm_now(); 16 - } 17 - 18 - static u64 tic_sys_freq_get() 19 - { 20 - return 1000000000; 21 - } 22 - 23 - static tic80* tic = NULL; 24 - 25 - static void app_init(void) 26 - { 27 - saudio_desc desc = {0}; 28 - desc.num_channels = 2; 29 - saudio_setup(&desc); 30 - 31 - FILE* file = fopen(TIC80_DEFAULT_CART, "rb"); 32 - 33 - if(file) 34 - { 35 - fseek(file, 0, SEEK_END); 36 - int size = ftell(file); 37 - fseek(file, 0, SEEK_SET); 38 - 39 - void* cart = malloc(size); 40 - if(cart) fread(cart, size, 1, file); 41 - fclose(file); 42 - 43 - if(cart) 44 - { 45 - printf("%s\n", "cart loaded"); 46 - tic = tic80_create(saudio_sample_rate(), TIC80_PIXEL_COLOR_RGBA8888); 47 - 48 - if(tic) 49 - { 50 - printf("%s\n", "tic created"); 51 - tic80_load(tic, cart, size); 52 - } 53 - } 54 - } 55 - 56 - sokol_gfx_init(TIC80_FULLWIDTH, TIC80_FULLHEIGHT, 1, 1, false, false); 57 - 58 - stm_setup(); 59 - } 60 - 61 - static tic80_input tic_input; 62 - 63 - static void app_frame(void) 64 - { 65 - if(tic) 66 - { 67 - tic80_tick(tic, tic_input, tic_sys_counter_get, tic_sys_freq_get); 68 - tic80_sound(tic); 69 - } 70 - 71 - sokol_gfx_draw(tic->screen); 72 - 73 - static float floatSamples[TIC80_SAMPLERATE * TIC80_SAMPLE_CHANNELS / TIC80_FRAMERATE]; 74 - 75 - for(s32 i = 0; i < tic->samples.count; i++) 76 - floatSamples[i] = (float)tic->samples.buffer[i] / SHRT_MAX; 77 - 78 - saudio_push(floatSamples, tic->samples.count / TIC80_SAMPLE_CHANNELS); 79 - } 80 - 81 - static void app_input(const sapp_event* event) 82 - { 83 - static const sapp_keycode Keys[] = 84 - { 85 - SAPP_KEYCODE_UP, 86 - SAPP_KEYCODE_DOWN, 87 - SAPP_KEYCODE_LEFT, 88 - SAPP_KEYCODE_RIGHT, 89 - 90 - SAPP_KEYCODE_Z, 91 - SAPP_KEYCODE_X, 92 - SAPP_KEYCODE_A, 93 - SAPP_KEYCODE_S, 94 - }; 95 - 96 - switch (event->type) 97 - { 98 - case SAPP_EVENTTYPE_KEY_DOWN: 99 - case SAPP_EVENTTYPE_KEY_UP: 100 - 101 - for (int i = 0; i < sizeof Keys / sizeof Keys[0]; i++) 102 - { 103 - if (event->key_code == Keys[i]) 104 - { 105 - if(event->type == SAPP_EVENTTYPE_KEY_DOWN) 106 - tic_input.gamepads.first.data |= (1 << i); 107 - else 108 - tic_input.gamepads.first.data &= ~(1 << i); 109 - } 110 - } 111 - break; 112 - default: 113 - break; 114 - } 115 - } 116 - 117 - static void app_cleanup(void) 118 - { 119 - if(tic) 120 - tic80_delete(tic); 121 - 122 - sg_shutdown(); 123 - } 124 - 125 - sapp_desc sokol_main(int argc, char* argv[]) { 126 - // args_init(argc, argv); 127 - return (sapp_desc) { 128 - .init_cb = app_init, 129 - .frame_cb = app_frame, 130 - .event_cb = app_input, 131 - .cleanup_cb = app_cleanup, 132 - .width = 3 * TIC80_FULLWIDTH, 133 - .height = 3 * TIC80_FULLHEIGHT, 134 - .window_title = TIC80_WINDOW_TITLE, 135 - .ios_keyboard_resizes_canvas = true 136 - }; 137 - }
-442
src/system/sokol/sokol.c
··· 1 - // MIT License 2 - 3 - // Copyright (c) 2017 Vadim Grigoruk @nesbox // grigoruk@gmail.com 4 - 5 - // Permission is hereby granted, free of charge, to any person obtaining a copy 6 - // of this software and associated documentation files (the "Software"), to deal 7 - // in the Software without restriction, including without limitation the rights 8 - // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 - // copies of the Software, and to permit persons to whom the Software is 10 - // furnished to do so, subject to the following conditions: 11 - 12 - // The above copyright notice and this permission notice shall be included in all 13 - // copies or substantial portions of the Software. 14 - 15 - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 - // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 - // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 - // SOFTWARE. 22 - 23 - #include <stdio.h> 24 - #include <stdlib.h> 25 - #include <string.h> 26 - #include <time.h> 27 - #include <limits.h> 28 - 29 - #include "studio/system.h" 30 - #include "system/sokol/sokol.h" 31 - 32 - #if defined(__TIC_WINDOWS__) 33 - #include <windows.h> 34 - #endif 35 - 36 - static struct 37 - { 38 - Studio* studio; 39 - tic80_input input; 40 - 41 - struct 42 - { 43 - bool state[tic_keys_count]; 44 - char text; 45 - } keyboard; 46 - 47 - struct 48 - { 49 - saudio_desc desc; 50 - float* samples; 51 - } audio; 52 - 53 - char* clipboard; 54 - 55 - } platform; 56 - 57 - void tic_sys_clipboard_set(const char* text) 58 - { 59 - if(platform.clipboard) 60 - { 61 - free(platform.clipboard); 62 - platform.clipboard = NULL; 63 - } 64 - 65 - platform.clipboard = strdup(text); 66 - } 67 - 68 - bool tic_sys_clipboard_has() 69 - { 70 - return platform.clipboard != NULL; 71 - } 72 - 73 - char* tic_sys_clipboard_get() 74 - { 75 - return platform.clipboard ? strdup(platform.clipboard) : NULL; 76 - } 77 - 78 - void tic_sys_clipboard_free(const char* text) 79 - { 80 - free((void*)text); 81 - } 82 - 83 - u64 tic_sys_counter_get() 84 - { 85 - return stm_now(); 86 - } 87 - 88 - u64 tic_sys_freq_get() 89 - { 90 - return 1000000000; 91 - } 92 - 93 - void tic_sys_fullscreen_set(bool value) 94 - { 95 - } 96 - 97 - bool tic_sys_fullscreen_get() 98 - { 99 - } 100 - 101 - void tic_sys_message(const char* title, const char* message) 102 - { 103 - } 104 - 105 - void tic_sys_title(const char* title) 106 - { 107 - } 108 - 109 - void tic_sys_open_path(const char* path) {} 110 - void tic_sys_open_url(const char* url) {} 111 - 112 - void tic_sys_preseed() 113 - { 114 - #if defined(__TIC_MACOSX__) 115 - srandom(time(NULL)); 116 - random(); 117 - #else 118 - srand(time(NULL)); 119 - rand(); 120 - #endif 121 - } 122 - 123 - void tic_sys_update_config() 124 - { 125 - 126 - } 127 - 128 - void tic_sys_default_mapping(tic_mapping* mapping) 129 - { 130 - *mapping = (tic_mapping) 131 - { 132 - tic_key_up, 133 - tic_key_down, 134 - tic_key_left, 135 - tic_key_right, 136 - 137 - tic_key_z, // a 138 - tic_key_x, // b 139 - tic_key_a, // x 140 - tic_key_s, // y 141 - }; 142 - } 143 - 144 - bool tic_sys_keyboard_text(char* text) 145 - { 146 - *text = platform.keyboard.text; 147 - return true; 148 - } 149 - 150 - static void app_init(void) 151 - { 152 - sokol_gfx_init(TIC80_FULLWIDTH, TIC80_FULLHEIGHT, 1, 1, false, true); 153 - 154 - stm_setup(); 155 - 156 - platform.audio.samples = calloc(sizeof platform.audio.samples[0], saudio_sample_rate() / TIC80_FRAMERATE * TIC80_SAMPLE_CHANNELS); 157 - } 158 - 159 - static void handleKeyboard() 160 - { 161 - tic80_input* input = &platform.input; 162 - input->keyboard.data = 0; 163 - 164 - enum{BufSize = COUNT_OF(input->keyboard.keys)}; 165 - 166 - for(s32 i = 0, c = 0; i < COUNT_OF(platform.keyboard.state) && c < BufSize; i++) 167 - if(platform.keyboard.state[i]) 168 - input->keyboard.keys[c++] = i; 169 - } 170 - 171 - static void app_frame(void) 172 - { 173 - if(studio_alive(platform.studio)) exit(0); 174 - 175 - const tic80* product = &studio_mem(platform.studio)->product; 176 - tic80_input* input = &platform.input; 177 - 178 - input->gamepads.data = 0; 179 - handleKeyboard(); 180 - studio_tick(platform.studio, platform.input); 181 - 182 - sokol_gfx_draw(product->screen); 183 - 184 - studio_sound(platform.studio); 185 - s32 count = product->samples.count; 186 - for(s32 i = 0; i < count; i++) 187 - platform.audio.samples[i] = (float)product->samples.buffer[i] / SHRT_MAX; 188 - 189 - saudio_push(platform.audio.samples, count / TIC80_SAMPLE_CHANNELS); 190 - 191 - input->mouse.scrollx = input->mouse.scrolly = 0; 192 - platform.keyboard.text = '\0'; 193 - } 194 - 195 - static void handleKeydown(sapp_keycode keycode, bool down) 196 - { 197 - static const tic_keycode KeyboardCodes[] = 198 - { 199 - [SAPP_KEYCODE_INVALID] = tic_key_unknown, 200 - [SAPP_KEYCODE_SPACE] = tic_key_space, 201 - [SAPP_KEYCODE_APOSTROPHE] = tic_key_apostrophe, 202 - [SAPP_KEYCODE_COMMA] = tic_key_comma, 203 - [SAPP_KEYCODE_MINUS] = tic_key_minus, 204 - [SAPP_KEYCODE_PERIOD] = tic_key_period, 205 - [SAPP_KEYCODE_SLASH] = tic_key_slash, 206 - [SAPP_KEYCODE_0] = tic_key_0, 207 - [SAPP_KEYCODE_1] = tic_key_1, 208 - [SAPP_KEYCODE_2] = tic_key_2, 209 - [SAPP_KEYCODE_3] = tic_key_3, 210 - [SAPP_KEYCODE_4] = tic_key_4, 211 - [SAPP_KEYCODE_5] = tic_key_5, 212 - [SAPP_KEYCODE_6] = tic_key_6, 213 - [SAPP_KEYCODE_7] = tic_key_7, 214 - [SAPP_KEYCODE_8] = tic_key_8, 215 - [SAPP_KEYCODE_9] = tic_key_9, 216 - [SAPP_KEYCODE_SEMICOLON] = tic_key_semicolon, 217 - [SAPP_KEYCODE_EQUAL] = tic_key_equals, 218 - [SAPP_KEYCODE_A] = tic_key_a, 219 - [SAPP_KEYCODE_B] = tic_key_b, 220 - [SAPP_KEYCODE_C] = tic_key_c, 221 - [SAPP_KEYCODE_D] = tic_key_d, 222 - [SAPP_KEYCODE_E] = tic_key_e, 223 - [SAPP_KEYCODE_F] = tic_key_f, 224 - [SAPP_KEYCODE_G] = tic_key_g, 225 - [SAPP_KEYCODE_H] = tic_key_h, 226 - [SAPP_KEYCODE_I] = tic_key_i, 227 - [SAPP_KEYCODE_J] = tic_key_j, 228 - [SAPP_KEYCODE_K] = tic_key_k, 229 - [SAPP_KEYCODE_L] = tic_key_l, 230 - [SAPP_KEYCODE_M] = tic_key_m, 231 - [SAPP_KEYCODE_N] = tic_key_n, 232 - [SAPP_KEYCODE_O] = tic_key_o, 233 - [SAPP_KEYCODE_P] = tic_key_p, 234 - [SAPP_KEYCODE_Q] = tic_key_q, 235 - [SAPP_KEYCODE_R] = tic_key_r, 236 - [SAPP_KEYCODE_S] = tic_key_s, 237 - [SAPP_KEYCODE_T] = tic_key_t, 238 - [SAPP_KEYCODE_U] = tic_key_u, 239 - [SAPP_KEYCODE_V] = tic_key_v, 240 - [SAPP_KEYCODE_W] = tic_key_w, 241 - [SAPP_KEYCODE_X] = tic_key_x, 242 - [SAPP_KEYCODE_Y] = tic_key_y, 243 - [SAPP_KEYCODE_Z] = tic_key_z, 244 - [SAPP_KEYCODE_LEFT_BRACKET] = tic_key_leftbracket, 245 - [SAPP_KEYCODE_BACKSLASH] = tic_key_backslash, 246 - [SAPP_KEYCODE_RIGHT_BRACKET] = tic_key_rightbracket, 247 - [SAPP_KEYCODE_GRAVE_ACCENT] = tic_key_grave, 248 - [SAPP_KEYCODE_WORLD_1] = tic_key_unknown, 249 - [SAPP_KEYCODE_WORLD_2] = tic_key_unknown, 250 - [SAPP_KEYCODE_ESCAPE] = tic_key_escape, 251 - [SAPP_KEYCODE_ENTER] = tic_key_return, 252 - [SAPP_KEYCODE_TAB] = tic_key_tab, 253 - [SAPP_KEYCODE_BACKSPACE] = tic_key_backspace, 254 - [SAPP_KEYCODE_INSERT] = tic_key_insert, 255 - [SAPP_KEYCODE_DELETE] = tic_key_delete, 256 - [SAPP_KEYCODE_RIGHT] = tic_key_right, 257 - [SAPP_KEYCODE_LEFT] = tic_key_left, 258 - [SAPP_KEYCODE_DOWN] = tic_key_down, 259 - [SAPP_KEYCODE_UP] = tic_key_up, 260 - [SAPP_KEYCODE_PAGE_UP] = tic_key_pageup, 261 - [SAPP_KEYCODE_PAGE_DOWN] = tic_key_pagedown, 262 - [SAPP_KEYCODE_HOME] = tic_key_home, 263 - [SAPP_KEYCODE_END] = tic_key_end, 264 - [SAPP_KEYCODE_CAPS_LOCK] = tic_key_capslock, 265 - [SAPP_KEYCODE_SCROLL_LOCK] = tic_key_unknown, 266 - [SAPP_KEYCODE_NUM_LOCK] = tic_key_unknown, 267 - [SAPP_KEYCODE_PRINT_SCREEN] = tic_key_unknown, 268 - [SAPP_KEYCODE_PAUSE] = tic_key_unknown, 269 - [SAPP_KEYCODE_F1] = tic_key_f1, 270 - [SAPP_KEYCODE_F2] = tic_key_f2, 271 - [SAPP_KEYCODE_F3] = tic_key_f3, 272 - [SAPP_KEYCODE_F4] = tic_key_f4, 273 - [SAPP_KEYCODE_F5] = tic_key_f5, 274 - [SAPP_KEYCODE_F6] = tic_key_f6, 275 - [SAPP_KEYCODE_F7] = tic_key_f7, 276 - [SAPP_KEYCODE_F8] = tic_key_f8, 277 - [SAPP_KEYCODE_F9] = tic_key_f9, 278 - [SAPP_KEYCODE_F10] = tic_key_f10, 279 - [SAPP_KEYCODE_F11] = tic_key_f11, 280 - [SAPP_KEYCODE_F12] = tic_key_f12, 281 - [SAPP_KEYCODE_F13] = tic_key_unknown, 282 - [SAPP_KEYCODE_F14] = tic_key_unknown, 283 - [SAPP_KEYCODE_F15] = tic_key_unknown, 284 - [SAPP_KEYCODE_F16] = tic_key_unknown, 285 - [SAPP_KEYCODE_F17] = tic_key_unknown, 286 - [SAPP_KEYCODE_F18] = tic_key_unknown, 287 - [SAPP_KEYCODE_F19] = tic_key_unknown, 288 - [SAPP_KEYCODE_F20] = tic_key_unknown, 289 - [SAPP_KEYCODE_F21] = tic_key_unknown, 290 - [SAPP_KEYCODE_F22] = tic_key_unknown, 291 - [SAPP_KEYCODE_F23] = tic_key_unknown, 292 - [SAPP_KEYCODE_F24] = tic_key_unknown, 293 - [SAPP_KEYCODE_F25] = tic_key_unknown, 294 - [SAPP_KEYCODE_KP_0] = tic_key_numpad0, 295 - [SAPP_KEYCODE_KP_1] = tic_key_numpad1, 296 - [SAPP_KEYCODE_KP_2] = tic_key_numpad2, 297 - [SAPP_KEYCODE_KP_3] = tic_key_numpad3, 298 - [SAPP_KEYCODE_KP_4] = tic_key_numpad4, 299 - [SAPP_KEYCODE_KP_5] = tic_key_numpad5, 300 - [SAPP_KEYCODE_KP_6] = tic_key_numpad6, 301 - [SAPP_KEYCODE_KP_7] = tic_key_numpad7, 302 - [SAPP_KEYCODE_KP_8] = tic_key_numpad8, 303 - [SAPP_KEYCODE_KP_9] = tic_key_numpad9, 304 - [SAPP_KEYCODE_KP_DECIMAL] = tic_key_numpadperiod, 305 - [SAPP_KEYCODE_KP_DIVIDE] = tic_key_numpaddivide, 306 - [SAPP_KEYCODE_KP_MULTIPLY] = tic_key_numpadmultiply, 307 - [SAPP_KEYCODE_KP_SUBTRACT] = tic_key_numpadminus, 308 - [SAPP_KEYCODE_KP_ADD] = tic_key_numpadplus, 309 - [SAPP_KEYCODE_KP_ENTER] = tic_key_numpadenter, 310 - [SAPP_KEYCODE_KP_EQUAL] = tic_key_equals, 311 - [SAPP_KEYCODE_LEFT_SHIFT] = tic_key_shift, 312 - [SAPP_KEYCODE_LEFT_CONTROL] = tic_key_ctrl, 313 - [SAPP_KEYCODE_LEFT_ALT] = tic_key_alt, 314 - [SAPP_KEYCODE_LEFT_SUPER] = tic_key_unknown, 315 - [SAPP_KEYCODE_RIGHT_SHIFT] = tic_key_shift, 316 - [SAPP_KEYCODE_RIGHT_CONTROL] = tic_key_ctrl, 317 - [SAPP_KEYCODE_RIGHT_ALT] = tic_key_alt, 318 - [SAPP_KEYCODE_RIGHT_SUPER] = tic_key_unknown, 319 - [SAPP_KEYCODE_MENU] = tic_key_unknown, 320 - 321 - }; 322 - 323 - tic_key key = KeyboardCodes[keycode]; 324 - 325 - if(key > tic_key_unknown) 326 - { 327 - // ALT+TAB fix 328 - if(key == tic_key_tab && platform.keyboard.state[tic_key_alt]) 329 - platform.keyboard.state[tic_key_alt] = false; 330 - 331 - platform.keyboard.state[key] = down; 332 - } 333 - } 334 - 335 - static void processMouse(sapp_mousebutton btn, s32 down) 336 - { 337 - tic80_input* input = &platform.input; 338 - 339 - switch(btn) 340 - { 341 - case SAPP_MOUSEBUTTON_LEFT: input->mouse.left = down; break; 342 - case SAPP_MOUSEBUTTON_MIDDLE: input->mouse.middle = down; break; 343 - case SAPP_MOUSEBUTTON_RIGHT: input->mouse.right = down; break; 344 - default: break; 345 - } 346 - } 347 - 348 - static void app_input(const sapp_event* event) 349 - { 350 - tic80_input* input = &platform.input; 351 - 352 - switch(event->type) 353 - { 354 - case SAPP_EVENTTYPE_KEY_DOWN: 355 - handleKeydown(event->key_code, true); 356 - break; 357 - case SAPP_EVENTTYPE_KEY_UP: 358 - handleKeydown(event->key_code, false); 359 - break; 360 - case SAPP_EVENTTYPE_CHAR: 361 - if(event->char_code < 128) 362 - platform.keyboard.text = event->char_code; 363 - break; 364 - case SAPP_EVENTTYPE_MOUSE_MOVE: 365 - { 366 - struct {s32 x, y, w, h;}rect; 367 - sokol_calc_viewport(&rect.x, &rect.y, &rect.w, &rect.h); 368 - 369 - if (rect.w) { 370 - s32 temp_x = ((s32)event->mouse_x - rect.x) * TIC80_FULLWIDTH / rect.w; 371 - if (temp_x < 0) temp_x = 0; else if (temp_x >= TIC80_FULLWIDTH) temp_x = TIC80_FULLWIDTH-1; // clip: 0 to TIC80_FULLWIDTH-1 372 - input->mouse.x = temp_x; 373 - } 374 - if (rect.h) { 375 - s32 temp_y = ((s32)event->mouse_y - rect.y) * TIC80_FULLHEIGHT / rect.h; 376 - if (temp_y < 0) temp_y = 0; else if (temp_y >= TIC80_FULLHEIGHT) temp_y = TIC80_FULLHEIGHT-1; // clip: 0 to TIC80_FULLHEIGHT-1 377 - input->mouse.y = temp_y; 378 - } 379 - } 380 - break; 381 - case SAPP_EVENTTYPE_MOUSE_DOWN: 382 - processMouse(event->mouse_button, 1); break; 383 - break; 384 - case SAPP_EVENTTYPE_MOUSE_UP: 385 - processMouse(event->mouse_button, 0); break; 386 - break; 387 - case SAPP_EVENTTYPE_MOUSE_SCROLL: 388 - input->mouse.scrollx = event->scroll_x; 389 - input->mouse.scrolly = event->scroll_y; 390 - break; 391 - default: 392 - break; 393 - } 394 - } 395 - 396 - static void app_cleanup(void) 397 - { 398 - studio_delete(platform.studio); 399 - free(platform.audio.samples); 400 - } 401 - 402 - sapp_desc sokol_main(s32 argc, char* argv[]) 403 - { 404 - #if defined(__TIC_WINDOWS__) 405 - { 406 - CONSOLE_SCREEN_BUFFER_INFO info; 407 - if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &info) && !info.dwCursorPosition.X && !info.dwCursorPosition.Y) 408 - FreeConsole(); 409 - } 410 - #endif 411 - 412 - memset(&platform, 0, sizeof platform); 413 - 414 - platform.audio.desc.num_channels = TIC80_SAMPLE_CHANNELS; 415 - saudio_setup(&platform.audio.desc); 416 - 417 - platform.studio = studio_create(argc, argv, saudio_sample_rate(), TIC80_PIXEL_COLOR_RGBA8888, "./", INT32_MAX); 418 - 419 - if(studio_config(platform.studio)->cli) 420 - { 421 - while (!studio_alive(platform.studio)) 422 - studio_tick(platform.studio, platform.input); 423 - 424 - exit(0); 425 - } 426 - 427 - const s32 Width = TIC80_FULLWIDTH * studio_config(platform.studio)->uiScale; 428 - const s32 Height = TIC80_FULLHEIGHT * studio_config(platform.studio)->uiScale; 429 - 430 - return(sapp_desc) 431 - { 432 - .init_cb = app_init, 433 - .frame_cb = app_frame, 434 - .event_cb = app_input, 435 - .cleanup_cb = app_cleanup, 436 - .width = Width, 437 - .height = Height, 438 - .window_title = TIC_TITLE, 439 - .ios_keyboard_resizes_canvas = true, 440 - .high_dpi = true, 441 - }; 442 - }
-34
src/system/sokol/sokol.h
··· 1 - // MIT License 2 - 3 - // Copyright (c) 2017 Vadim Grigoruk @nesbox // grigoruk@gmail.com 4 - 5 - // Permission is hereby granted, free of charge, to any person obtaining a copy 6 - // of this software and associated documentation files (the "Software"), to deal 7 - // in the Software without restriction, including without limitation the rights 8 - // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 - // copies of the Software, and to permit persons to whom the Software is 10 - // furnished to do so, subject to the following conditions: 11 - 12 - // The above copyright notice and this permission notice shall be included in all 13 - // copies or substantial portions of the Software. 14 - 15 - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 - // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 - // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 - // SOFTWARE. 22 - 23 - #pragma once 24 - 25 - #include "sokol_app.h" 26 - #include "sokol_gfx.h" 27 - #include "sokol_time.h" 28 - #include "sokol_audio.h" 29 - 30 - #include <stdint.h> 31 - 32 - void sokol_calc_viewport(int* x, int* y, int* w, int* h); 33 - void sokol_gfx_init(int w, int h, int sx, int sy, bool integer_scale, bool portrait_top_align); 34 - void sokol_gfx_draw(const uint32_t* ptr);
-228
src/system/sokol/sokol_gfx.c
··· 1 - #include "sokol.h" 2 - 3 - static struct 4 - { 5 - sg_draw_state draw_state; 6 - int fb_width; 7 - int fb_height; 8 - int fb_aspect_scale_x; 9 - int fb_aspect_scale_y; 10 - 11 - bool integer_scale; 12 - bool portrait_top_align; 13 - } sokol_gfx; 14 - 15 - #if defined(SOKOL_GLCORE33) 16 - static const char* gfx_vs_src = 17 - "#version 330\n" 18 - "in vec2 in_pos;\n" 19 - "in vec2 in_uv;\n" 20 - "out vec2 uv;\n" 21 - "void main() {\n" 22 - " gl_Position = vec4(in_pos*2.0-1.0, 0.5, 1.0);\n" 23 - " uv = in_uv;\n" 24 - "}\n"; 25 - static const char* gfx_fs_src = 26 - "#version 330\n" 27 - "uniform sampler2D tex;\n" 28 - "in vec2 uv;\n" 29 - "out vec4 frag_color;\n" 30 - "void main() {\n" 31 - " frag_color = texture(tex, uv);\n" 32 - "}\n"; 33 - #elif defined(SOKOL_GLES2) 34 - static const char* gfx_vs_src = 35 - "attribute vec2 in_pos;\n" 36 - "attribute vec2 in_uv;\n" 37 - "varying vec2 uv;\n" 38 - "void main() {\n" 39 - " gl_Position = vec4(in_pos*2.0-1.0, 0.5, 1.0);\n" 40 - " uv = in_uv;\n" 41 - "}\n"; 42 - static const char* gfx_fs_src = 43 - "precision mediump float;\n" 44 - "uniform sampler2D tex;" 45 - "varying vec2 uv;\n" 46 - "void main() {\n" 47 - " gl_FragColor = texture2D(tex, uv);\n" 48 - "}\n"; 49 - #elif defined(SOKOL_METAL) 50 - static const char* gfx_vs_src = 51 - "#include <metal_stdlib>\n" 52 - "using namespace metal;\n" 53 - "struct vs_in {\n" 54 - " float2 pos [[attribute(0)]];\n" 55 - " float2 uv [[attribute(1)]];\n" 56 - "};\n" 57 - "struct vs_out {\n" 58 - " float4 pos [[position]];\n" 59 - " float2 uv;\n" 60 - "};\n" 61 - "vertex vs_out _main(vs_in in [[stage_in]]) {\n" 62 - " vs_out out;\n" 63 - " out.pos = float4(in.pos*2.0-1.0, 0.5, 1.0);\n" 64 - " out.uv = in.uv;\n" 65 - " return out;\n" 66 - "}\n"; 67 - static const char* gfx_fs_src = 68 - "#include <metal_stdlib>\n" 69 - "using namespace metal;\n" 70 - "struct fs_in {\n" 71 - " float2 uv;\n" 72 - "};\n" 73 - "fragment float4 _main(fs_in in [[stage_in]], texture2d<float> tex [[texture(0)]], sampler smp [[sampler(0)]]) {\n" 74 - " return tex.sample(smp, in.uv);\n" 75 - "}\n"; 76 - #elif defined(SOKOL_D3D11) 77 - static const char* gfx_vs_src = 78 - "struct vs_in {\n" 79 - " float2 pos: POS;\n" 80 - " float2 uv: UV;\n" 81 - "};\n" 82 - "struct vs_out {\n" 83 - " float2 uv: TEXCOORD0;\n" 84 - " float4 pos: SV_Position;\n" 85 - "};\n" 86 - "vs_out main(vs_in inp) {\n" 87 - " vs_out outp;\n" 88 - " outp.pos = float4(inp.pos*2.0-1.0, 0.5, 1.0);\n" 89 - " outp.uv = inp.uv;\n" 90 - " return outp;\n" 91 - "}\n"; 92 - static const char* gfx_fs_src = 93 - "Texture2D<float4> tex: register(t0);\n" 94 - "sampler smp: register(s0);\n" 95 - "float4 main(float2 uv: TEXCOORD0): SV_Target0 {\n" 96 - " return tex.Sample(smp, uv);\n" 97 - "}\n"; 98 - #endif 99 - 100 - void sokol_gfx_init(int w, int h, int sx, int sy, bool integer_scale, bool portrait_top_align) { 101 - sokol_gfx.fb_width = w; 102 - sokol_gfx.fb_height = h; 103 - sokol_gfx.fb_aspect_scale_x = sx; 104 - sokol_gfx.fb_aspect_scale_y = sy; 105 - sokol_gfx.integer_scale = integer_scale; 106 - sokol_gfx.portrait_top_align = portrait_top_align; 107 - 108 - sg_setup(&(sg_desc){ 109 - .mtl_device = sapp_metal_get_device(), 110 - .mtl_renderpass_descriptor_cb = sapp_metal_get_renderpass_descriptor, 111 - .mtl_drawable_cb = sapp_metal_get_drawable, 112 - .d3d11_device = sapp_d3d11_get_device(), 113 - .d3d11_device_context = sapp_d3d11_get_device_context(), 114 - .d3d11_render_target_view_cb = sapp_d3d11_get_render_target_view, 115 - .d3d11_depth_stencil_view_cb = sapp_d3d11_get_depth_stencil_view 116 - }); 117 - 118 - /* the vertex buffer representing screen rectangle */ 119 - float verts[] = { 120 - 0.0f, 0.0f, 0.0f, 1.0f, 121 - 1.0f, 0.0f, 1.0f, 1.0f, 122 - 0.0f, 1.0f, 0.0f, 0.0f, 123 - 1.0f, 1.0f, 1.0f, 0.0f 124 - }; 125 - sokol_gfx.draw_state.vertex_buffers[0] = sg_make_buffer(&(sg_buffer_desc){ 126 - .size = sizeof(verts), 127 - .content = verts, 128 - }); 129 - 130 - /* a shader to render a textured quad */ 131 - sg_shader fsq_shd = sg_make_shader(&(sg_shader_desc){ 132 - .fs.images = { 133 - [0] = { .name="tex", .type=SG_IMAGETYPE_2D }, 134 - }, 135 - .vs.source = gfx_vs_src, 136 - .fs.source = gfx_fs_src, 137 - }); 138 - 139 - /* a pipeline-state-object for rendering */ 140 - sg_pipeline_desc pip_desc = { 141 - .layout = { 142 - .attrs[0] = { .name="in_pos", .sem_name="POS", .format=SG_VERTEXFORMAT_FLOAT2 }, 143 - .attrs[1] = { .name="in_uv", .sem_name="UV", .format=SG_VERTEXFORMAT_FLOAT2 } 144 - }, 145 - .shader = fsq_shd, 146 - .primitive_type = SG_PRIMITIVETYPE_TRIANGLE_STRIP 147 - }; 148 - sokol_gfx.draw_state.pipeline = sg_make_pipeline(&pip_desc); 149 - 150 - /* a texture with the pixel data */ 151 - sokol_gfx.draw_state.fs_images[0] = sg_make_image(&(sg_image_desc){ 152 - .width = sokol_gfx.fb_width, 153 - .height = sokol_gfx.fb_height, 154 - .pixel_format = SG_PIXELFORMAT_RGBA8, 155 - .usage = SG_USAGE_STREAM, 156 - .min_filter = SG_FILTER_NEAREST, 157 - .mag_filter = SG_FILTER_NEAREST, 158 - .wrap_u = SG_WRAP_CLAMP_TO_EDGE, 159 - .wrap_v = SG_WRAP_CLAMP_TO_EDGE 160 - }); 161 - } 162 - 163 - static const sg_pass_action gfx_draw_pass_action = { 164 - .colors[0] = { .action = SG_ACTION_CLEAR, .val = { 0.05f, 0.05f, 0.05f, 1.0f } } 165 - }; 166 - 167 - void sokol_calc_viewport(int* x, int* y, int* w, int* h) 168 - { 169 - int vp_x = 0, vp_y = 0, vp_w = sapp_width(), vp_h = sapp_height(); 170 - 171 - if (vp_w * sokol_gfx.fb_height < vp_h * sokol_gfx.fb_width) 172 - { 173 - int discreteWidth = vp_w - (sokol_gfx.integer_scale ? vp_w % sokol_gfx.fb_width : 0); 174 - int discreteHeight = sokol_gfx.fb_height * discreteWidth / sokol_gfx.fb_width; 175 - 176 - vp_x = (vp_w - discreteWidth) / 2; 177 - vp_y = sokol_gfx.portrait_top_align && vp_w < vp_h 178 - ? 0 179 - : (vp_h - discreteHeight) / 2; 180 - 181 - vp_w = discreteWidth; 182 - vp_h = discreteHeight; 183 - } 184 - else 185 - { 186 - int discreteHeight = vp_h - (sokol_gfx.integer_scale ? vp_h % sokol_gfx.fb_height : 0); 187 - int discreteWidth = sokol_gfx.fb_width * discreteHeight / sokol_gfx.fb_height; 188 - 189 - vp_x = (vp_w - discreteWidth) / 2; 190 - vp_y = (vp_h - discreteHeight) / 2; 191 - 192 - vp_w = discreteWidth; 193 - vp_h = discreteHeight; 194 - } 195 - 196 - *x = vp_x; 197 - *y = vp_y; 198 - *w = vp_w; 199 - *h = vp_h; 200 - } 201 - 202 - 203 - static void apply_viewport(void) { 204 - 205 - int vp_x, vp_y, vp_w, vp_h; 206 - sokol_calc_viewport(&vp_x, &vp_y, &vp_w, &vp_h); 207 - 208 - sg_apply_viewport(vp_x, vp_y, vp_w, vp_h, true); 209 - } 210 - 211 - void sokol_gfx_draw(const uint32_t* ptr) { 212 - 213 - /* copy pixel data into the source texture */ 214 - sg_update_image(sokol_gfx.draw_state.fs_images[0], &(sg_image_content){ 215 - .subimage[0][0] = { 216 - .ptr = ptr, 217 - .size = sokol_gfx.fb_width*sokol_gfx.fb_height*sizeof ptr[0] 218 - } 219 - }); 220 - 221 - /* draw to the screen */ 222 - sg_begin_default_pass(&gfx_draw_pass_action, sapp_width(), sapp_height()); 223 - apply_viewport(); 224 - sg_apply_draw_state(&sokol_gfx.draw_state); 225 - sg_draw(0, 4, 1); 226 - sg_end_pass(); 227 - sg_commit(); 228 - }
-36
src/system/sokol/sokol_impl.c
··· 1 - // MIT License 2 - 3 - // Copyright (c) 2017 Vadim Grigoruk @nesbox // grigoruk@gmail.com 4 - 5 - // Permission is hereby granted, free of charge, to any person obtaining a copy 6 - // of this software and associated documentation files (the "Software"), to deal 7 - // in the Software without restriction, including without limitation the rights 8 - // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 - // copies of the Software, and to permit persons to whom the Software is 10 - // furnished to do so, subject to the following conditions: 11 - 12 - // The above copyright notice and this permission notice shall be included in all 13 - // copies or substantial portions of the Software. 14 - 15 - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 - // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 - // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 - // SOFTWARE. 22 - 23 - #define SOKOL_IMPL 24 - 25 - #if defined(WIN32) 26 - 27 - #ifndef WM_MOUSEHWHEEL 28 - #define WM_MOUSEHWHEEL 0x020E 29 - #endif 30 - 31 - #endif 32 - 33 - #include "sokol_app.h" 34 - #include "sokol_gfx.h" 35 - #include "sokol_time.h" 36 - #include "sokol_audio.h"
-28
src/system/sokol/sokol_impl.m
··· 1 - // MIT License 2 - 3 - // Copyright (c) 2017 Vadim Grigoruk @nesbox // grigoruk@gmail.com 4 - 5 - // Permission is hereby granted, free of charge, to any person obtaining a copy 6 - // of this software and associated documentation files (the "Software"), to deal 7 - // in the Software without restriction, including without limitation the rights 8 - // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 - // copies of the Software, and to permit persons to whom the Software is 10 - // furnished to do so, subject to the following conditions: 11 - 12 - // The above copyright notice and this permission notice shall be included in all 13 - // copies or substantial portions of the Software. 14 - 15 - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 - // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 - // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 - // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 - // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 - // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 - // SOFTWARE. 22 - 23 - #define SOKOL_IMPL 24 - 25 - #include "sokol_app.h" 26 - #include "sokol_gfx.h" 27 - #include "sokol_time.h" 28 - #include "sokol_audio.h"
-4
tic80.sublime-project
··· 21 21 "shell_cmd": "cd ${project_path}/build && cmake -DBUILD_STATIC=OFF .." 22 22 }, 23 23 { 24 - "name": "BUILD_SOKOL=ON", 25 - "shell_cmd": "cd ${project_path}/build && cmake -DBUILD_SOKOL=ON .." 26 - }, 27 - { 28 24 "name": "BUILD_PRO=ON", 29 25 "shell_cmd": "cd ${project_path}/build && cmake -DBUILD_PRO=ON .." 30 26 },