| 1 | /** |
| 2 | * MojoShader; generate shader programs from bytecode of compiled |
| 3 | * Direct3D shaders. |
| 4 | * |
| 5 | * Please see the file LICENSE.txt in the source's root directory. |
| 6 | * |
| 7 | * This file written by Ryan C. Gordon. |
| 8 | */ |
| 9 | |
| 10 | #include <stdio.h> |
| 11 | #include "mojoshader.h"cxx . . $ `<file>/mojoshader.h`/ |
| 12 | #include "SDL.h" |
| 13 | |
| 14 | static void *lookupcxx . . $ lookup(327a34a4567101e7).(const char *fnname, void *unused) |
| 15 | { |
| 16 | (void) unused; |
| 17 | return SDL_GL_GetProcAddresscxx . . $ SDL_GL_GetProcAddress(42228c1987407501).(fnname); |
| 18 | } // lookup |
| 19 | |
| 20 | static int check_availablecxx . . $ check_available(b126dc7c1de90089).(void) |
| 21 | { |
| 22 | const char **avail = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 23 | int total = MOJOSHADER_glAvailableProfilescxx . . $ MOJOSHADER_glAvailableProfiles(3b3a24d9228d4570).(lookupcxx . . $ lookup(327a34a4567101e7)., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, 0, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 24 | if (total > 0) |
| 25 | { |
| 26 | avail = (const char **) allocacxx . . $ `<external>/11612401604547820122/alloca.h:35:10`!(sizeof (const char *) * total); |
| 27 | total = MOJOSHADER_glAvailableProfilescxx . . $ MOJOSHADER_glAvailableProfiles(3b3a24d9228d4570).(lookupcxx . . $ lookup(327a34a4567101e7)., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, avail, total, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 28 | } // if |
| 29 | |
| 30 | if (total <= 0) |
| 31 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "No profiles available.\n"); |
| 32 | else |
| 33 | { |
| 34 | int i; |
| 35 | for (i = 0; i < total; i++) |
| 36 | { |
| 37 | printfcxx . . $ printf(581fddd72a8db8fc).("%s (Shader Model %d)\n", avail[i], |
| 38 | MOJOSHADER_maxShaderModelcxx . . $ MOJOSHADER_maxShaderModel(5c4306d8553b3696).(avail[i])); |
| 39 | } // for |
| 40 | } // else |
| 41 | |
| 42 | return 0; |
| 43 | } // check_available |
| 44 | |
| 45 | |
| 46 | int maincxx . . $ main(afcd3168fc1188a4).(int argc, char **argv) |
| 47 | { |
| 48 | int retval = 1; |
| 49 | |
| 50 | #if 0 |
| 51 | printf("MojoShader availableprofile\n"); |
| 52 | printf("Compiled against changeset %s\n", MOJOSHADER_CHANGESET); |
| 53 | printf("Linked against changeset %s\n", MOJOSHADER_changeset()); |
| 54 | printf("\n"); |
| 55 | #endif |
| 56 | |
| 57 | SDL_Windowcxx . . $ SDL_Window# *sdlwindow = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 58 | if (SDL_Initcxx . . $ SDL_Init(4c679297bf94b9eb).(SDL_INIT_VIDEOcxx . . $ `<external>/13597568925221565411/SDL.h:85:9`!) == -1) |
| 59 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "SDL_Init() error: %s\n", SDL_GetErrorcxx . . $ SDL_GetError(33a1f659e94feb42).()); |
| 60 | else if (SDL_GL_LoadLibrarycxx . . $ SDL_GL_LoadLibrary(5c4306d8553b3696).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) == -1) |
| 61 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "SDL_GL_LoadLibrary() error: %s\n", SDL_GetErrorcxx . . $ SDL_GetError(33a1f659e94feb42).()); |
| 62 | else if ((sdlwindow = SDL_CreateWindowcxx . . $ SDL_CreateWindow(2360bbcd09caf609).(argv[0], SDL_WINDOWPOS_UNDEFINEDcxx . . $ `<external>/14887343297790812595/SDL_video.h:138:9`!, SDL_WINDOWPOS_UNDEFINEDcxx . . $ `<external>/14887343297790812595/SDL_video.h:138:9`!, 640, 480, SDL_WINDOW_OPENGLcxx . . $ SDL_WINDOW_OPENGL.)) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 63 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "SDL_CreateWindow() error: %s\n", SDL_GetErrorcxx . . $ SDL_GetError(33a1f659e94feb42).()); |
| 64 | else if (SDL_GL_CreateContextcxx . . $ SDL_GL_CreateContext(f7c79fd5aa0bf365).(sdlwindow) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 65 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "SDL_GL_CreateContext() error: %s\n", SDL_GetErrorcxx . . $ SDL_GetError(33a1f659e94feb42).()); |
| 66 | else |
| 67 | retval = check_availablecxx . . $ check_available(b126dc7c1de90089).(); |
| 68 | |
| 69 | SDL_Quitcxx . . $ SDL_Quit(49f6e7a06ebc5aa8).(); |
| 70 | return retval; |
| 71 | } // main |
| 72 | |
| 73 | // end of availableprofiles.c ... |
| 74 |