| 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 | int maincxx . . $ main(afcd3168fc1188a4).(int argc, char **argv) |
| 21 | { |
| 22 | int retval = 1; |
| 23 | |
| 24 | #if 0 |
| 25 | printf("MojoShader bestprofile\n"); |
| 26 | printf("Compiled against changeset %s\n", MOJOSHADER_CHANGESET); |
| 27 | printf("Linked against changeset %s\n", MOJOSHADER_changeset()); |
| 28 | printf("\n"); |
| 29 | #endif |
| 30 | |
| 31 | SDL_Windowcxx . . $ SDL_Window# *sdlwindow = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 32 | if (SDL_Initcxx . . $ SDL_Init(4c679297bf94b9eb).(SDL_INIT_VIDEOcxx . . $ `<external>/13597568925221565411/SDL.h:85:9`!) == -1) |
| 33 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "SDL_Init() error: %s\n", SDL_GetErrorcxx . . $ SDL_GetError(33a1f659e94feb42).()); |
| 34 | else if (SDL_GL_LoadLibrarycxx . . $ SDL_GL_LoadLibrary(5c4306d8553b3696).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) == -1) |
| 35 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "SDL_GL_LoadLibrary() error: %s\n", SDL_GetErrorcxx . . $ SDL_GetError(33a1f659e94feb42).()); |
| 36 | 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`!) |
| 37 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "SDL_CreateWindow() error: %s\n", SDL_GetErrorcxx . . $ SDL_GetError(33a1f659e94feb42).()); |
| 38 | else if (SDL_GL_CreateContextcxx . . $ SDL_GL_CreateContext(f7c79fd5aa0bf365).(sdlwindow) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 39 | fprintfcxx . . $ fprintf(bc216f8e5b1ebeac).(stderrcxx . . $ `<external>/232824719582829767/stdio.h:155:9`!, "SDL_GL_CreateContext() error: %s\n", SDL_GetErrorcxx . . $ SDL_GetError(33a1f659e94feb42).()); |
| 40 | else |
| 41 | { |
| 42 | const char *best = MOJOSHADER_glBestProfilecxx . . $ MOJOSHADER_glBestProfile(9e574eee0221474a).(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`!, 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`!); |
| 43 | MOJOSHADER_glContextcxx . . $ MOJOSHADER_glContext# *ctx = MOJOSHADER_glCreateContextcxx . . $ MOJOSHADER_glCreateContext(9bd61f5b213a9467).(best, lookupcxx . . $ lookup(327a34a4567101e7)., 0, 0, 0, 0); |
| 44 | if (ctx == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 45 | printfcxx . . $ printf(581fddd72a8db8fc).("MOJOSHADER_glCreateContext() fail: %s\n", MOJOSHADER_glGetErrorcxx . . $ MOJOSHADER_glGetError(33a1f659e94feb42).()); |
| 46 | else |
| 47 | { |
| 48 | printfcxx . . $ printf(581fddd72a8db8fc).("%s\n", best); |
| 49 | retval = 0; // success. |
| 50 | MOJOSHADER_glDestroyContextcxx . . $ MOJOSHADER_glDestroyContext(512d40087428bebb).(ctx); |
| 51 | } // else |
| 52 | } // else |
| 53 | |
| 54 | SDL_Quitcxx . . $ SDL_Quit(49f6e7a06ebc5aa8).(); |
| 55 | return retval; |
| 56 | } // main |
| 57 | |
| 58 | // end of bestprofile.c ... |
| 59 |