this repo has no description
0
fork

Configure Feed

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

Fixed some VS warnings. Added a bunch of annoying DECLSPEC and SDLCALL declarators that probably mean something to VS.

+388 -343
+1 -1
LICENSE.txt
··· 1 1 The MIT License (MIT) 2 - Copyright (c) 2014 Jonathan Dearborn 2 + Copyright (c) 2015 Jonathan Dearborn 3 3 4 4 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 5
+87 -45
SDL_gpu/SDL_gpu.c
··· 22 22 #define CHECK_CONTEXT (current_renderer->current_context_target != NULL) 23 23 #define RETURN_ERROR(code, details) do{ GPU_PushErrorCode(__func__, code, "%s", details); return; } while(0) 24 24 25 - void GPU_InitRendererRegister(void); 26 - GPU_Renderer* GPU_AddRenderer(GPU_RendererID id); 25 + void GPU_InitRendererRegister(void); 26 + GPU_Renderer* GPU_AddRenderer(GPU_RendererID id); 27 27 void GPU_RemoveRenderer(GPU_RendererID id); 28 28 29 29 static GPU_Renderer* current_renderer = NULL; ··· 185 185 return required_features; 186 186 } 187 187 188 - static void init_error_stack() 188 + static void init_error_stack(void) 189 189 { 190 190 if(!inited_error_code_stack) 191 191 { ··· 199 199 } 200 200 } 201 201 202 - static void init_window_mappings() 202 + static void init_window_mappings(void) 203 203 { 204 204 if(window_mappings == NULL) 205 205 { ··· 228 228 for(i = 0; i < num_window_mappings; i++) 229 229 { 230 230 if(window_mappings[i].windowID == windowID) 231 - { 231 + { 232 232 if(window_mappings[i].target != target) 233 233 GPU_PushErrorCode(__func__, GPU_ERROR_DATA_ERROR, "WindowID %u already has a mapping.", windowID); 234 234 return; ··· 249 249 250 250 // Add to end of list 251 251 { 252 - GPU_WindowMapping m = { windowID, target }; 252 + GPU_WindowMapping m; 253 + m.windowID = windowID; 254 + m.target = target; 253 255 window_mappings[num_window_mappings] = m; 254 256 } 255 257 num_window_mappings++; ··· 396 398 screen = renderer->impl->Init(renderer, renderer_request, w, h, SDL_flags); 397 399 if(screen == NULL) 398 400 { 399 - // Init failed, destroy the renderer... 400 - // Erase the window mappings 401 + // Init failed, destroy the renderer... 402 + // Erase the window mappings 401 403 num_window_mappings = 0; 402 404 GPU_CloseCurrentRenderer(); 403 405 } ··· 643 645 644 646 GPU_Rect GPU_MakeRect(float x, float y, float w, float h) 645 647 { 646 - GPU_Rect r = {x, y, w, h}; 648 + GPU_Rect r; 649 + r.x = x; 650 + r.y = y; 651 + r.w = w; 652 + r.h = h; 653 + 647 654 return r; 648 655 } 649 656 650 657 SDL_Color GPU_MakeColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a) 651 658 { 652 - SDL_Color c = {r, g, b, a}; 659 + SDL_Color c; 660 + c.r = r; 661 + c.g = g; 662 + c.b = b; 663 + c.a = a; 664 + 653 665 return c; 654 666 } 655 667 656 668 GPU_RendererID GPU_MakeRendererID(const char* name, GPU_RendererEnum renderer, int major_version, int minor_version) 657 669 { 658 - GPU_RendererID r = {name, renderer, major_version, minor_version, -1}; 670 + GPU_RendererID r; 671 + r.name = name; 672 + r.renderer = renderer; 673 + r.major_version = major_version; 674 + r.minor_version = minor_version; 675 + r.index = -1; 676 + 659 677 return r; 660 678 } 661 679 ··· 849 867 850 868 for(i = 0; i < 256; i++) 851 869 { 852 - colors[i].r = colors[i].g = colors[i].b = i; 870 + colors[i].r = colors[i].g = colors[i].b = (Uint8)i; 853 871 } 854 872 855 873 /* Set palette */ ··· 892 910 data = surface->pixels; 893 911 894 912 if(SDL_strcasecmp(extension, "png") == 0) 895 - result = stbi_write_png(filename, surface->w, surface->h, surface->format->BytesPerPixel, (const unsigned char *const)data, 0); 913 + result = (stbi_write_png(filename, surface->w, surface->h, surface->format->BytesPerPixel, (const unsigned char *const)data, 0) > 0); 896 914 else if(SDL_strcasecmp(extension, "bmp") == 0) 897 - result = stbi_write_bmp(filename, surface->w, surface->h, surface->format->BytesPerPixel, (void*)data); 915 + result = (stbi_write_bmp(filename, surface->w, surface->h, surface->format->BytesPerPixel, (void*)data) > 0); 898 916 else if(SDL_strcasecmp(extension, "tga") == 0) 899 - result = stbi_write_tga(filename, surface->w, surface->h, surface->format->BytesPerPixel, (void*)data); 917 + result = (stbi_write_tga(filename, surface->w, surface->h, surface->format->BytesPerPixel, (void*)data) > 0); 900 918 else 901 919 { 902 920 GPU_PushErrorCode(__func__, GPU_ERROR_DATA_ERROR, "Unsupported output file format"); ··· 1088 1106 int size; 1089 1107 float* new_values; 1090 1108 1091 - int n; // The sprite number iteration variable. 1109 + unsigned int n; // The sprite number iteration variable. 1092 1110 // Source indices (per sprite) 1093 1111 int pos_n; 1094 1112 int rect_n; ··· 1103 1121 float w2; // texcoord helpers for position expansion 1104 1122 float h2; 1105 1123 1106 - float tex_w; 1107 - float tex_h; 1124 + Uint32 tex_w; 1125 + Uint32 tex_h; 1108 1126 1109 1127 if(!CHECK_RENDERER) 1110 1128 RETURN_ERROR(GPU_ERROR_USER_ERROR, "NULL renderer"); ··· 1136 1154 src_rect_floats_per_sprite = 4; 1137 1155 src_color_floats_per_sprite = 4; 1138 1156 1139 - no_positions = (flags & GPU_USE_DEFAULT_POSITIONS); 1140 - no_rects = (flags & GPU_USE_DEFAULT_SRC_RECTS); 1141 - no_colors = (flags & GPU_USE_DEFAULT_COLORS); 1142 - pass_vertices = (flags & GPU_PASSTHROUGH_VERTICES); 1143 - pass_texcoords = (flags & GPU_PASSTHROUGH_TEXCOORDS); 1144 - pass_colors = (flags & GPU_PASSTHROUGH_COLORS); 1157 + no_positions = (Uint8)(flags & GPU_USE_DEFAULT_POSITIONS); 1158 + no_rects = (Uint8)(flags & GPU_USE_DEFAULT_SRC_RECTS); 1159 + no_colors = (Uint8)(flags & GPU_USE_DEFAULT_COLORS); 1160 + pass_vertices = (Uint8)(flags & GPU_PASSTHROUGH_VERTICES); 1161 + pass_texcoords = (Uint8)(flags & GPU_PASSTHROUGH_TEXCOORDS); 1162 + pass_colors = (Uint8)(flags & GPU_PASSTHROUGH_COLORS); 1145 1163 1146 1164 // Passthrough data is per-vertex. Non-passthrough is per-sprite. They can't interleave cleanly. 1147 1165 if(flags & GPU_PASSTHROUGH_ALL && (flags & GPU_PASSTHROUGH_ALL) != GPU_PASSTHROUGH_ALL) ··· 1409 1427 int size; // 4 vertices of x, y... s, t... r, g, b, a 1410 1428 float* values; 1411 1429 1412 - int n; // The sprite number iteration variable. 1430 + unsigned int n; // The sprite number iteration variable. 1413 1431 // Source indices 1414 1432 int pos_n; 1415 1433 int rect_n; ··· 1424 1442 float w2; // texcoord helpers for position expansion 1425 1443 float h2; 1426 1444 1427 - float tex_w; 1428 - float tex_h; 1445 + Uint32 tex_w; 1446 + Uint32 tex_h; 1429 1447 1430 1448 if(!CHECK_RENDERER) 1431 1449 RETURN_ERROR(GPU_ERROR_USER_ERROR, "NULL renderer"); ··· 1450 1468 // Repack the given arrays into an interleaved array for more efficient access 1451 1469 // Default values: Each sprite is defined by a position, a rect, and a color. 1452 1470 1453 - pass_vertices = (flags & GPU_PASSTHROUGH_VERTICES); 1454 - pass_texcoords = (flags & GPU_PASSTHROUGH_TEXCOORDS); 1455 - pass_colors = (flags & GPU_PASSTHROUGH_COLORS); 1471 + pass_vertices = (Uint8)(flags & GPU_PASSTHROUGH_VERTICES); 1472 + pass_texcoords = (Uint8)(flags & GPU_PASSTHROUGH_TEXCOORDS); 1473 + pass_colors = (Uint8)(flags & GPU_PASSTHROUGH_COLORS); 1456 1474 1457 1475 size = num_sprites*(8 + 8 + 16); // 4 vertices of x, y... s, t... r, g, b, a 1458 1476 values = (float*)malloc(sizeof(float)*size); ··· 1700 1718 int size; 1701 1719 float* new_values; 1702 1720 1703 - int n; // Vertex number iteration variable 1721 + unsigned int n; // Vertex number iteration variable 1704 1722 // Source indices 1705 1723 int pos_n; 1706 1724 int texcoord_n; ··· 1708 1726 // Dest indices 1709 1727 int vert_i; 1710 1728 1711 - float tex_w; 1712 - float tex_h; 1729 + Uint32 tex_w; 1730 + Uint32 tex_h; 1713 1731 1714 1732 Uint8 using_texture = (image != NULL); 1715 1733 ··· 1741 1759 src_texcoord_floats_per_vertex = 2; 1742 1760 src_color_floats_per_vertex = 4; 1743 1761 1744 - no_positions = (flags & GPU_USE_DEFAULT_POSITIONS); 1745 - no_texcoords = (flags & GPU_USE_DEFAULT_SRC_RECTS) || !using_texture; 1746 - no_colors = (flags & GPU_USE_DEFAULT_COLORS); 1747 - pass_texcoords = (flags & GPU_PASSTHROUGH_TEXCOORDS); 1748 - pass_colors = (flags & GPU_PASSTHROUGH_COLORS); 1762 + no_positions = (Uint8)(flags & GPU_USE_DEFAULT_POSITIONS); 1763 + no_texcoords = (Uint8)(flags & GPU_USE_DEFAULT_SRC_RECTS) || !using_texture; 1764 + no_colors = (Uint8)(flags & GPU_USE_DEFAULT_COLORS); 1765 + pass_texcoords = (Uint8)(flags & GPU_PASSTHROUGH_TEXCOORDS); 1766 + pass_colors = (Uint8)(flags & GPU_PASSTHROUGH_COLORS); 1749 1767 1750 1768 // Vertex position passthrough is ignored (we're not positioning triangles, we're positioning vertices already) 1751 1769 src_position_floats_per_vertex = 2; // x, y ··· 1801 1819 } 1802 1820 else 1803 1821 { 1804 - if(!pass_texcoords) 1822 + if(!pass_texcoords && using_texture) 1805 1823 { 1806 1824 new_values[vert_i++] = values[texcoord_n]/tex_w; 1807 1825 new_values[vert_i++] = values[texcoord_n+1]/tex_h; ··· 1869 1887 return r; 1870 1888 } 1871 1889 1872 - return current_renderer->impl->SetClip(current_renderer, target, rect.x, rect.y, rect.w, rect.h); 1890 + return current_renderer->impl->SetClip(current_renderer, target, (Sint16)rect.x, (Sint16)rect.y, (Uint16)rect.w, (Uint16)rect.h); 1873 1891 } 1874 1892 1875 1893 GPU_Rect GPU_SetClip(GPU_Target* target, Sint16 x, Sint16 y, Uint16 w, Uint16 h) ··· 1904 1922 1905 1923 void GPU_SetRGB(GPU_Image* image, Uint8 r, Uint8 g, Uint8 b) 1906 1924 { 1907 - SDL_Color c = {r, g, b, 255}; 1925 + SDL_Color c; 1926 + c.r = r; 1927 + c.g = g; 1928 + c.b = b; 1929 + c.a = 255; 1908 1930 1909 1931 if(image == NULL) 1910 1932 return; ··· 1914 1936 1915 1937 void GPU_SetRGBA(GPU_Image* image, Uint8 r, Uint8 g, Uint8 b, Uint8 a) 1916 1938 { 1917 - SDL_Color c = {r, g, b, a}; 1939 + SDL_Color c; 1940 + c.r = r; 1941 + c.g = g; 1942 + c.b = b; 1943 + c.a = a; 1918 1944 1919 1945 if(image == NULL) 1920 1946 return; ··· 1942 1968 1943 1969 void GPU_SetTargetRGB(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b) 1944 1970 { 1945 - SDL_Color c = {r, g, b, 255}; 1971 + SDL_Color c; 1972 + c.r = r; 1973 + c.g = g; 1974 + c.b = b; 1975 + c.a = 255; 1976 + 1946 1977 if(target == NULL) 1947 1978 return; 1948 1979 ··· 1952 1983 1953 1984 void GPU_SetTargetRGBA(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a) 1954 1985 { 1955 - SDL_Color c = {r, g, b, a}; 1986 + SDL_Color c; 1987 + c.r = r; 1988 + c.g = g; 1989 + c.b = b; 1990 + c.a = a; 1991 + 1956 1992 if(target == NULL) 1957 1993 return; 1958 1994 ··· 2403 2439 2404 2440 GPU_AttributeFormat GPU_MakeAttributeFormat(int num_elems_per_vertex, GPU_TypeEnum type, Uint8 normalize, int stride_bytes, int offset_bytes) 2405 2441 { 2406 - GPU_AttributeFormat f = {0, num_elems_per_vertex, type, normalize, stride_bytes, offset_bytes}; 2442 + GPU_AttributeFormat f; 2443 + f.is_per_sprite = 0; 2444 + f.num_elems_per_value = num_elems_per_vertex; 2445 + f.type = type; 2446 + f.normalize = normalize; 2447 + f.stride_bytes = stride_bytes; 2448 + f.offset_bytes = offset_bytes; 2407 2449 return f; 2408 2450 } 2409 2451
+199 -196
SDL_gpu/SDL_gpu.h
··· 5 5 #include <stdio.h> 6 6 #include <stdarg.h> 7 7 8 + // Use SDL's DLL defines 9 + #include "begin_code.h" 8 10 9 11 #ifdef __cplusplus 10 12 extern "C" { ··· 574 576 575 577 // Visual C does not support static inline 576 578 #ifdef _MSC_VER 577 - static SDL_version GPU_GetCompiledVersion(void) 579 + static SDL_version SDLCALL GPU_GetCompiledVersion(void) 578 580 #else 579 - static inline SDL_version GPU_GetCompiledVersion(void) 581 + static inline SDL_version SDLCALL GPU_GetCompiledVersion(void) 580 582 #endif 581 583 { 582 584 SDL_version v = {SDL_GPU_VERSION_MAJOR, SDL_GPU_VERSION_MINOR, SDL_GPU_VERSION_PATCH}; 583 585 return v; 584 586 } 585 587 586 - SDL_version GPU_GetLinkedVersion(void); 588 + DECLSPEC SDL_version SDLCALL GPU_GetLinkedVersion(void); 587 589 588 590 /*! The window corresponding to 'windowID' will be used to create the rendering context instead of creating a new window. */ 589 - void GPU_SetInitWindow(Uint32 windowID); 591 + DECLSPEC void SDLCALL GPU_SetInitWindow(Uint32 windowID); 590 592 591 593 /*! Returns the window ID that has been set via GPU_SetInitWindow(). */ 592 - Uint32 GPU_GetInitWindow(void); 594 + DECLSPEC Uint32 SDLCALL GPU_GetInitWindow(void); 593 595 594 596 /*! Set special flags to use for initialization. Set these before calling GPU_Init(). 595 597 * \param GPU_flags An OR'ed combination of GPU_InitFlagEnum flags. Default flags (0) enable late swap vsync and double buffering. */ 596 - void GPU_SetPreInitFlags(GPU_InitFlagEnum GPU_flags); 598 + DECLSPEC void SDLCALL GPU_SetPreInitFlags(GPU_InitFlagEnum GPU_flags); 597 599 598 600 /*! Returns the current special flags to use for initialization. */ 599 - GPU_InitFlagEnum GPU_GetPreInitFlags(void); 601 + DECLSPEC GPU_InitFlagEnum SDLCALL GPU_GetPreInitFlags(void); 600 602 601 603 /*! Set required features to use for initialization. Set these before calling GPU_Init(). 602 604 * \param features An OR'ed combination of GPU_FeatureEnum flags. Required features will force GPU_Init() to create a renderer that supports all of the given flags or else fail. */ 603 - void GPU_SetRequiredFeatures(GPU_FeatureEnum features); 605 + DECLSPEC void SDLCALL GPU_SetRequiredFeatures(GPU_FeatureEnum features); 604 606 605 607 /*! Returns the current required features to use for initialization. */ 606 - GPU_FeatureEnum GPU_GetRequiredFeatures(void); 608 + DECLSPEC GPU_FeatureEnum SDLCALL GPU_GetRequiredFeatures(void); 607 609 608 610 /*! Gets the default initialization renderer IDs for the current platform copied into the 'order' array and the number of renderer IDs into 'order_size'. Pass NULL for 'order' to just get the size of the renderer order array. Will return at most GPU_RENDERER_ORDER_MAX renderers. */ 609 - void GPU_GetDefaultRendererOrder(int* order_size, GPU_RendererID* order); 611 + DECLSPEC void SDLCALL GPU_GetDefaultRendererOrder(int* order_size, GPU_RendererID* order); 610 612 611 613 /*! Gets the current renderer ID order for initialization copied into the 'order' array and the number of renderer IDs into 'order_size'. Pass NULL for 'order' to just get the size of the renderer order array. */ 612 - void GPU_GetRendererOrder(int* order_size, GPU_RendererID* order); 614 + DECLSPEC void SDLCALL GPU_GetRendererOrder(int* order_size, GPU_RendererID* order); 613 615 614 616 /*! Sets the renderer ID order to use for initialization. If 'order' is NULL, it will restore the default order. */ 615 - void GPU_SetRendererOrder(int order_size, GPU_RendererID* order); 617 + DECLSPEC void SDLCALL GPU_SetRendererOrder(int order_size, GPU_RendererID* order); 616 618 617 619 /*! Initializes SDL and SDL_gpu. Creates a window and goes through the renderer order to create a renderer context. 618 620 * \see GPU_SetRendererOrder() 619 621 */ 620 - GPU_Target* GPU_Init(Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags); 622 + DECLSPEC GPU_Target* SDLCALL GPU_Init(Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags); 621 623 622 624 /*! Initializes SDL and SDL_gpu. Creates a window and the requested renderer context. */ 623 - GPU_Target* GPU_InitRenderer(GPU_RendererEnum renderer_enum, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags); 625 + DECLSPEC GPU_Target* SDLCALL GPU_InitRenderer(GPU_RendererEnum renderer_enum, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags); 624 626 625 627 /*! Initializes SDL and SDL_gpu. Creates a window and the requested renderer context. 626 628 * By requesting a renderer via ID, you can specify the major and minor versions of an individual renderer backend. 627 629 * \see GPU_MakeRendererID 628 630 */ 629 - GPU_Target* GPU_InitRendererByID(GPU_RendererID renderer_request, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags); 631 + DECLSPEC GPU_Target* SDLCALL GPU_InitRendererByID(GPU_RendererID renderer_request, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags); 630 632 631 633 /*! Checks for important GPU features which may not be supported depending on a device's extension support. Feature flags (GPU_FEATURE_*) can be bitwise OR'd together. 632 634 * \return 1 if all of the passed features are enabled/supported 633 635 * \return 0 if any of the passed features are disabled/unsupported 634 636 */ 635 - Uint8 GPU_IsFeatureEnabled(GPU_FeatureEnum feature); 637 + DECLSPEC Uint8 SDLCALL GPU_IsFeatureEnabled(GPU_FeatureEnum feature); 636 638 637 639 /*! Clean up the renderer state. */ 638 - void GPU_CloseCurrentRenderer(void); 640 + DECLSPEC void SDLCALL GPU_CloseCurrentRenderer(void); 639 641 640 642 /*! Clean up the renderer state and shut down SDL_gpu. */ 641 - void GPU_Quit(void); 643 + DECLSPEC void SDLCALL GPU_Quit(void); 642 644 643 645 // End of Initialization 644 646 /*! @} */ ··· 657 659 * GPU_DEBUG_LEVEL_2: Elevates warning logs to error priority 658 660 * GPU_DEBUG_LEVEL_3: Elevates info logs to error priority 659 661 */ 660 - void GPU_SetDebugLevel(GPU_DebugLevelEnum level); 662 + DECLSPEC void SDLCALL GPU_SetDebugLevel(GPU_DebugLevelEnum level); 661 663 662 664 /*! Returns the current global debug level. */ 663 - GPU_DebugLevelEnum GPU_GetDebugLevel(void); 665 + DECLSPEC GPU_DebugLevelEnum SDLCALL GPU_GetDebugLevel(void); 664 666 665 667 /*! Prints an informational log message. */ 666 - void GPU_LogInfo(const char* format, ...); 668 + DECLSPEC void SDLCALL GPU_LogInfo(const char* format, ...); 667 669 668 670 /*! Prints a warning log message. */ 669 - void GPU_LogWarning(const char* format, ...); 671 + DECLSPEC void SDLCALL GPU_LogWarning(const char* format, ...); 670 672 671 673 /*! Prints an error log message. */ 672 - void GPU_LogError(const char* format, ...); 674 + DECLSPEC void SDLCALL GPU_LogError(const char* format, ...); 673 675 674 676 /*! Pushes a new error code onto the error stack. If the stack is full, this function does nothing. 675 677 * \param function The name of the function that pushed the error 676 678 * \param error The error code to push on the error stack 677 679 * \param details Additional information string, can be NULL. 678 680 */ 679 - void GPU_PushErrorCode(const char* function, GPU_ErrorEnum error, const char* details, ...); 681 + DECLSPEC void SDLCALL GPU_PushErrorCode(const char* function, GPU_ErrorEnum error, const char* details, ...); 680 682 681 683 /*! Pops an error object from the error stack and returns it. If the error stack is empty, it returns an error object with NULL function, GPU_ERROR_NONE error, and NULL details. */ 682 - GPU_ErrorObject GPU_PopErrorCode(void); 684 + DECLSPEC GPU_ErrorObject SDLCALL GPU_PopErrorCode(void); 683 685 684 686 /*! Gets the string representation of an error code. */ 685 - const char* GPU_GetErrorString(GPU_ErrorEnum error); 687 + DECLSPEC const char* SDLCALL GPU_GetErrorString(GPU_ErrorEnum error); 686 688 687 689 // End of Logging 688 690 /*! @} */ ··· 697 699 * @{ */ 698 700 699 701 /*! Returns an initialized GPU_RendererID. */ 700 - GPU_RendererID GPU_MakeRendererID(const char* name, GPU_RendererEnum renderer, int major_version, int minor_version); 702 + DECLSPEC GPU_RendererID SDLCALL GPU_MakeRendererID(const char* name, GPU_RendererEnum renderer, int major_version, int minor_version); 701 703 702 704 /*! Gets the first registered renderer identifier for the given enum value. */ 703 - GPU_RendererID GPU_GetRendererID(GPU_RendererEnum renderer); 705 + DECLSPEC GPU_RendererID SDLCALL GPU_GetRendererID(GPU_RendererEnum renderer); 704 706 705 707 /*! Gets the renderer identifier for the given registration index. */ 706 - GPU_RendererID GPU_GetRendererIDByIndex(unsigned int index); 708 + DECLSPEC GPU_RendererID SDLCALL GPU_GetRendererIDByIndex(unsigned int index); 707 709 708 710 /*! Gets the number of registered (available) renderers. */ 709 - int GPU_GetNumRegisteredRenderers(void); 711 + DECLSPEC int SDLCALL GPU_GetNumRegisteredRenderers(void); 710 712 711 713 /*! Gets an array of identifiers for the registered (available) renderers. */ 712 - void GPU_GetRegisteredRendererList(GPU_RendererID* renderers_array); 714 + DECLSPEC void SDLCALL GPU_GetRegisteredRendererList(GPU_RendererID* renderers_array); 713 715 714 716 /*! Prepares a renderer for use by SDL_gpu. */ 715 - void GPU_RegisterRenderer(GPU_RendererID id, GPU_Renderer* (*create_renderer)(GPU_RendererID request), void (*free_renderer)(GPU_Renderer* renderer)); 717 + DECLSPEC void SDLCALL GPU_RegisterRenderer(GPU_RendererID id, GPU_Renderer* (*create_renderer)(GPU_RendererID request), void(*free_renderer)(GPU_Renderer* renderer)); 716 718 717 719 // End of RendererSetup 718 720 /*! @} */ ··· 723 725 * @{ */ 724 726 725 727 /*! Gets the next enum ID that can be used for a custom renderer. */ 726 - GPU_RendererEnum GPU_ReserveNextRendererEnum(void); 728 + DECLSPEC GPU_RendererEnum SDLCALL GPU_ReserveNextRendererEnum(void); 727 729 728 730 /*! Gets the number of active (created) renderers. */ 729 - int GPU_GetNumActiveRenderers(void); 731 + DECLSPEC int SDLCALL GPU_GetNumActiveRenderers(void); 730 732 731 733 /*! Gets an array of identifiers for the active renderers. */ 732 - void GPU_GetActiveRendererList(GPU_RendererID* renderers_array); 734 + DECLSPEC void SDLCALL GPU_GetActiveRendererList(GPU_RendererID* renderers_array); 733 735 734 736 /*! Gets the renderer for the given renderer index. */ 735 - GPU_Renderer* GPU_GetRenderer(unsigned int index); 737 + DECLSPEC GPU_Renderer* SDLCALL GPU_GetRenderer(unsigned int index); 736 738 737 739 /*! \return The renderer matching the given identifier. */ 738 - GPU_Renderer* GPU_GetRendererByID(GPU_RendererID id); 740 + DECLSPEC GPU_Renderer* SDLCALL GPU_GetRendererByID(GPU_RendererID id); 739 741 740 742 /*! \return The current renderer */ 741 - GPU_Renderer* GPU_GetCurrentRenderer(void); 743 + DECLSPEC GPU_Renderer* SDLCALL GPU_GetCurrentRenderer(void); 742 744 743 745 /*! Switches the current renderer to the renderer matching the given identifier. */ 744 - void GPU_SetCurrentRenderer(GPU_RendererID id); 746 + DECLSPEC void SDLCALL GPU_SetCurrentRenderer(GPU_RendererID id); 745 747 746 748 /*! Reapplies the renderer state to the backend API (e.g. OpenGL, Direct3D). Use this if you want SDL_gpu to be able to render after you've used direct backend calls. */ 747 - void GPU_ResetRendererState(void); 749 + DECLSPEC void SDLCALL GPU_ResetRendererState(void); 748 750 749 751 // End of RendererControls 750 752 /*! @} */ ··· 758 760 * @{ */ 759 761 760 762 /*! \return The renderer's current context target. */ 761 - GPU_Target* GPU_GetContextTarget(void); 763 + DECLSPEC GPU_Target* SDLCALL GPU_GetContextTarget(void); 762 764 763 765 /*! \return The target that is associated with the given windowID. */ 764 - GPU_Target* GPU_GetWindowTarget(Uint32 windowID); 766 + DECLSPEC GPU_Target* SDLCALL GPU_GetWindowTarget(Uint32 windowID); 765 767 766 768 /*! Creates a separate context for the given window using the current renderer and returns a GPU_Target that represents it. */ 767 - GPU_Target* GPU_CreateTargetFromWindow(Uint32 windowID); 769 + DECLSPEC GPU_Target* SDLCALL GPU_CreateTargetFromWindow(Uint32 windowID); 768 770 769 771 /*! Makes the given window the current rendering destination for the given context target. 770 772 * This also makes the target the current context for image loading and window operations. 771 773 * If the target does not represent a window, this does nothing. 772 774 */ 773 - void GPU_MakeCurrent(GPU_Target* target, Uint32 windowID); 775 + DECLSPEC void SDLCALL GPU_MakeCurrent(GPU_Target* target, Uint32 windowID); 774 776 775 777 /*! Change the actual size of the current context target's window. This resets the virtual resolution and viewport of the context target. 776 778 * Aside from direct resolution changes, this should also be called in response to SDL_WINDOWEVENT_RESIZED window events for resizable windows. */ 777 - Uint8 GPU_SetWindowResolution(Uint16 w, Uint16 h); 779 + DECLSPEC Uint8 SDLCALL GPU_SetWindowResolution(Uint16 w, Uint16 h); 778 780 779 781 /*! Enable/disable fullscreen mode for the current context target's window. 780 782 * On some platforms, this may destroy the renderer context and require that textures be reloaded. Unfortunately, SDL does not provide a notification mechanism for this. 781 783 * \param enable_fullscreen If true, make the application go fullscreen. If false, make the application go to windowed mode. 782 784 * \param use_desktop_resolution If true, lets the window change its resolution when it enters fullscreen mode (via SDL_WINDOW_FULLSCREEN_DESKTOP). 783 785 * \return 0 if the new mode is windowed, 1 if the new mode is fullscreen. */ 784 - Uint8 GPU_SetFullscreen(Uint8 enable_fullscreen, Uint8 use_desktop_resolution); 786 + DECLSPEC Uint8 SDLCALL GPU_SetFullscreen(Uint8 enable_fullscreen, Uint8 use_desktop_resolution); 785 787 786 788 /*! Returns true if the current context target's window is in fullscreen mode. */ 787 - Uint8 GPU_GetFullscreen(void); 789 + DECLSPEC Uint8 SDLCALL GPU_GetFullscreen(void); 788 790 789 791 /*! Enables/disables alpha blending for shape rendering on the current window. */ 790 - void GPU_SetShapeBlending(Uint8 enable); 792 + DECLSPEC void SDLCALL GPU_SetShapeBlending(Uint8 enable); 791 793 792 794 /*! Translates a blend preset into a blend mode. */ 793 - GPU_BlendMode GPU_GetBlendModeFromPreset(GPU_BlendPresetEnum preset); 795 + DECLSPEC GPU_BlendMode SDLCALL GPU_GetBlendModeFromPreset(GPU_BlendPresetEnum preset); 794 796 795 797 /*! Sets the blending component functions for shape rendering. */ 796 - void GPU_SetShapeBlendFunction(GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha); 798 + DECLSPEC void SDLCALL GPU_SetShapeBlendFunction(GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha); 797 799 798 800 /*! Sets the blending component equations for shape rendering. */ 799 - void GPU_SetShapeBlendEquation(GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation); 801 + DECLSPEC void SDLCALL GPU_SetShapeBlendEquation(GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation); 800 802 801 803 /*! Sets the blending mode for shape rendering on the current window, if supported by the renderer. */ 802 - void GPU_SetShapeBlendMode(GPU_BlendPresetEnum mode); 804 + DECLSPEC void SDLCALL GPU_SetShapeBlendMode(GPU_BlendPresetEnum mode); 803 805 804 806 /*! Sets the thickness of lines for the current context. 805 807 * \param thickness New line thickness in pixels measured across the line. Default is 1.0f. 806 808 * \return The old thickness value 807 809 */ 808 - float GPU_SetLineThickness(float thickness); 810 + DECLSPEC float SDLCALL GPU_SetLineThickness(float thickness); 809 811 810 812 /*! Returns the current line thickness value. */ 811 - float GPU_GetLineThickness(void); 813 + DECLSPEC float SDLCALL GPU_GetLineThickness(void); 812 814 813 815 // End of ContextControls 814 816 /*! @} */ ··· 821 823 822 824 /*! Creates a target that aliases the given target. Aliases can be used to store target settings (e.g. viewports) for easy switching. 823 825 * GPU_FreeTarget() frees the alias's memory, but does not affect the original. */ 824 - GPU_Target* GPU_CreateAliasTarget(GPU_Target* target); 826 + DECLSPEC GPU_Target* SDLCALL GPU_CreateAliasTarget(GPU_Target* target); 825 827 826 828 /*! Creates a new render target from the given image. It can then be accessed from image->target. */ 827 - GPU_Target* GPU_LoadTarget(GPU_Image* image); 829 + DECLSPEC GPU_Target* SDLCALL GPU_LoadTarget(GPU_Image* image); 828 830 829 831 /*! Deletes a render target in the proper way for this renderer. */ 830 - void GPU_FreeTarget(GPU_Target* target); 832 + DECLSPEC void SDLCALL GPU_FreeTarget(GPU_Target* target); 831 833 832 834 /*! Change the logical size of the given target. Rendering to this target will be scaled as if the dimensions were actually the ones given. */ 833 - void GPU_SetVirtualResolution(GPU_Target* target, Uint16 w, Uint16 h); 835 + DECLSPEC void SDLCALL GPU_SetVirtualResolution(GPU_Target* target, Uint16 w, Uint16 h); 834 836 835 837 /*! Converts screen space coordinates (such as from mouse input) to logical drawing coordinates. */ 836 - void GPU_GetVirtualCoords(GPU_Target* target, float* x, float* y, float displayX, float displayY); 838 + DECLSPEC void SDLCALL GPU_GetVirtualCoords(GPU_Target* target, float* x, float* y, float displayX, float displayY); 837 839 838 840 /*! Reset the logical size of the given target to its original value. */ 839 - void GPU_UnsetVirtualResolution(GPU_Target* target); 841 + DECLSPEC void SDLCALL GPU_UnsetVirtualResolution(GPU_Target* target); 840 842 841 843 /*! \return A GPU_Rect with the given values. */ 842 - GPU_Rect GPU_MakeRect(float x, float y, float w, float h); 844 + DECLSPEC GPU_Rect SDLCALL GPU_MakeRect(float x, float y, float w, float h); 843 845 844 846 /*! \return An SDL_Color with the given values. */ 845 - SDL_Color GPU_MakeColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a); 847 + DECLSPEC SDL_Color SDLCALL GPU_MakeColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a); 846 848 847 849 /*! Sets the given target's viewport. */ 848 - void GPU_SetViewport(GPU_Target* target, GPU_Rect viewport); 850 + DECLSPEC void SDLCALL GPU_SetViewport(GPU_Target* target, GPU_Rect viewport); 849 851 850 852 /*! \return A GPU_Camera with position (0, 0, -10), angle of 0, and zoom of 1. */ 851 - GPU_Camera GPU_GetDefaultCamera(void); 853 + DECLSPEC GPU_Camera SDLCALL GPU_GetDefaultCamera(void); 852 854 853 855 /*! \return The camera of the given render target. If target is NULL, returns the default camera. */ 854 - GPU_Camera GPU_GetCamera(GPU_Target* target); 856 + DECLSPEC GPU_Camera SDLCALL GPU_GetCamera(GPU_Target* target); 855 857 856 858 /*! Sets the current render target's current camera. 857 859 * \param target A pointer to the target that will copy this camera. 858 860 * \param cam A pointer to the camera data to use or NULL to use the default camera. 859 861 * \return The old camera. */ 860 - GPU_Camera GPU_SetCamera(GPU_Target* target, GPU_Camera* cam); 862 + DECLSPEC GPU_Camera SDLCALL GPU_SetCamera(GPU_Target* target, GPU_Camera* cam); 861 863 862 864 /*! \return The RGBA color of a pixel. */ 863 - SDL_Color GPU_GetPixel(GPU_Target* target, Sint16 x, Sint16 y); 865 + DECLSPEC SDL_Color SDLCALL GPU_GetPixel(GPU_Target* target, Sint16 x, Sint16 y); 864 866 865 867 /*! Sets the clipping rect for the given render target. */ 866 - GPU_Rect GPU_SetClipRect(GPU_Target* target, GPU_Rect rect); 868 + DECLSPEC GPU_Rect SDLCALL GPU_SetClipRect(GPU_Target* target, GPU_Rect rect); 867 869 868 870 /*! Sets the clipping rect for the given render target. */ 869 - GPU_Rect GPU_SetClip(GPU_Target* target, Sint16 x, Sint16 y, Uint16 w, Uint16 h); 871 + DECLSPEC GPU_Rect SDLCALL GPU_SetClip(GPU_Target* target, Sint16 x, Sint16 y, Uint16 w, Uint16 h); 870 872 871 873 /*! Turns off clipping for the given target. */ 872 - void GPU_UnsetClip(GPU_Target* target); 874 + DECLSPEC void SDLCALL GPU_UnsetClip(GPU_Target* target); 873 875 874 876 /*! Sets the modulation color for subsequent drawing of images and shapes on the given target. 875 877 * This has a cumulative effect with the image coloring functions. 876 878 * e.g. GPU_SetRGB(image, 255, 128, 0); GPU_SetTargetRGB(target, 128, 128, 128); 877 879 * Would make the image draw with color of roughly (128, 64, 0). 878 880 */ 879 - void GPU_SetTargetColor(GPU_Target* target, SDL_Color color); 881 + DECLSPEC void SDLCALL GPU_SetTargetColor(GPU_Target* target, SDL_Color color); 880 882 881 883 /*! Sets the modulation color for subsequent drawing of images and shapes on the given target. 882 884 * This has a cumulative effect with the image coloring functions. 883 885 * e.g. GPU_SetRGB(image, 255, 128, 0); GPU_SetTargetRGB(target, 128, 128, 128); 884 886 * Would make the image draw with color of roughly (128, 64, 0). 885 887 */ 886 - void GPU_SetTargetRGB(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b); 888 + DECLSPEC void SDLCALL GPU_SetTargetRGB(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b); 887 889 888 890 /*! Sets the modulation color for subsequent drawing of images and shapes on the given target. 889 891 * This has a cumulative effect with the image coloring functions. 890 892 * e.g. GPU_SetRGB(image, 255, 128, 0); GPU_SetTargetRGB(target, 128, 128, 128); 891 893 * Would make the image draw with color of roughly (128, 64, 0). 892 894 */ 893 - void GPU_SetTargetRGBA(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 895 + DECLSPEC void SDLCALL GPU_SetTargetRGBA(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 894 896 895 897 /*! Unsets the modulation color for subsequent drawing of images and shapes on the given target. 896 898 * This has the same effect as coloring with pure opaque white (255, 255, 255, 255). 897 899 */ 898 - void GPU_UnsetTargetColor(GPU_Target* target); 900 + DECLSPEC void SDLCALL GPU_UnsetTargetColor(GPU_Target* target); 899 901 900 902 // End of TargetControls 901 903 /*! @} */ ··· 906 908 * @{ */ 907 909 908 910 /*! Load surface from an image file that is supported by this renderer. Don't forget to SDL_FreeSurface() it. */ 909 - SDL_Surface* GPU_LoadSurface(const char* filename); 911 + DECLSPEC SDL_Surface* SDLCALL GPU_LoadSurface(const char* filename); 910 912 911 913 /*! Save surface to a file. The file type is deduced from the extension. Supported formats are: png, bmp, tga. Returns 0 on failure. */ 912 - Uint8 GPU_SaveSurface(SDL_Surface* surface, const char* filename); 914 + DECLSPEC Uint8 SDLCALL GPU_SaveSurface(SDL_Surface* surface, const char* filename); 913 915 914 916 // End of SurfaceControls 915 917 /*! @} */ ··· 925 927 * \param h Image height in pixels 926 928 * \param format Format of color channels. 927 929 */ 928 - GPU_Image* GPU_CreateImage(Uint16 w, Uint16 h, GPU_FormatEnum format); 930 + DECLSPEC GPU_Image* SDLCALL GPU_CreateImage(Uint16 w, Uint16 h, GPU_FormatEnum format); 929 931 930 932 /*! Create a new image that uses the given native texture handle as the image texture. */ 931 - GPU_Image* GPU_CreateImageUsingTexture(Uint32 handle, Uint8 take_ownership); 933 + DECLSPEC GPU_Image* SDLCALL GPU_CreateImageUsingTexture(Uint32 handle, Uint8 take_ownership); 932 934 933 935 /*! Load image from an image file that is supported by this renderer. Don't forget to GPU_FreeImage() it. */ 934 - GPU_Image* GPU_LoadImage(const char* filename); 936 + DECLSPEC GPU_Image* SDLCALL GPU_LoadImage(const char* filename); 935 937 936 938 /*! Creates an image that aliases the given image. Aliases can be used to store image settings (e.g. modulation color) for easy switching. 937 939 * GPU_FreeImage() frees the alias's memory, but does not affect the original. */ 938 - GPU_Image* GPU_CreateAliasImage(GPU_Image* image); 940 + DECLSPEC GPU_Image* SDLCALL GPU_CreateAliasImage(GPU_Image* image); 939 941 940 942 /*! Copy an image to a new image. Don't forget to GPU_FreeImage() both. */ 941 - GPU_Image* GPU_CopyImage(GPU_Image* image); 943 + DECLSPEC GPU_Image* SDLCALL GPU_CopyImage(GPU_Image* image); 942 944 943 945 /*! Deletes an image in the proper way for this renderer. Also deletes the corresponding GPU_Target if applicable. Be careful not to use that target afterward! */ 944 - void GPU_FreeImage(GPU_Image* image); 946 + DECLSPEC void SDLCALL GPU_FreeImage(GPU_Image* image); 945 947 946 948 /*! Update an image from surface data. */ 947 - void GPU_UpdateImage(GPU_Image* image, SDL_Surface* surface, const GPU_Rect* surface_rect); 949 + DECLSPEC void SDLCALL GPU_UpdateImage(GPU_Image* image, SDL_Surface* surface, const GPU_Rect* surface_rect); 948 950 949 951 /*! Update an image from surface data. */ 950 - void GPU_UpdateSubImage(GPU_Image* image, const GPU_Rect* image_rect, SDL_Surface* surface, const GPU_Rect* surface_rect); 952 + DECLSPEC void SDLCALL GPU_UpdateSubImage(GPU_Image* image, const GPU_Rect* image_rect, SDL_Surface* surface, const GPU_Rect* surface_rect); 951 953 952 954 /*! Update an image from an array of pixel data. */ 953 - void GPU_UpdateImageBytes(GPU_Image* image, const GPU_Rect* image_rect, const unsigned char* bytes, int bytes_per_row); 955 + DECLSPEC void SDLCALL GPU_UpdateImageBytes(GPU_Image* image, const GPU_Rect* image_rect, const unsigned char* bytes, int bytes_per_row); 954 956 955 957 /*! Save image to a file. The file type is deduced from the extension. Supported formats are: png, bmp, tga. Returns 0 on failure. */ 956 - Uint8 GPU_SaveImage(GPU_Image* image, const char* filename); 958 + DECLSPEC Uint8 SDLCALL GPU_SaveImage(GPU_Image* image, const char* filename); 957 959 958 960 /*! Loads mipmaps for the given image, if supported by the renderer. */ 959 - void GPU_GenerateMipmaps(GPU_Image* image); 961 + DECLSPEC void SDLCALL GPU_GenerateMipmaps(GPU_Image* image); 960 962 961 963 /*! Sets the modulation color for subsequent drawing of the given image. */ 962 - void GPU_SetColor(GPU_Image* image, SDL_Color color); 964 + DECLSPEC void SDLCALL GPU_SetColor(GPU_Image* image, SDL_Color color); 963 965 964 966 /*! Sets the modulation color for subsequent drawing of the given image. */ 965 - void GPU_SetRGB(GPU_Image* image, Uint8 r, Uint8 g, Uint8 b); 967 + DECLSPEC void SDLCALL GPU_SetRGB(GPU_Image* image, Uint8 r, Uint8 g, Uint8 b); 966 968 967 969 /*! Sets the modulation color for subsequent drawing of the given image. */ 968 - void GPU_SetRGBA(GPU_Image* image, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 970 + DECLSPEC void SDLCALL GPU_SetRGBA(GPU_Image* image, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 969 971 970 972 /*! Unsets the modulation color for subsequent drawing of the given image. 971 973 * This is equivalent to coloring with pure opaque white (255, 255, 255, 255). */ 972 - void GPU_UnsetColor(GPU_Image* image); 974 + DECLSPEC void SDLCALL GPU_UnsetColor(GPU_Image* image); 973 975 974 976 /*! Gets the current alpha blending setting. */ 975 - Uint8 GPU_GetBlending(GPU_Image* image); 977 + DECLSPEC Uint8 SDLCALL GPU_GetBlending(GPU_Image* image); 976 978 977 979 /*! Enables/disables alpha blending for the given image. */ 978 - void GPU_SetBlending(GPU_Image* image, Uint8 enable); 980 + DECLSPEC void SDLCALL GPU_SetBlending(GPU_Image* image, Uint8 enable); 979 981 980 982 /*! Sets the blending component functions. */ 981 - void GPU_SetBlendFunction(GPU_Image* image, GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha); 983 + DECLSPEC void SDLCALL GPU_SetBlendFunction(GPU_Image* image, GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha); 982 984 983 985 /*! Sets the blending component equations. */ 984 - void GPU_SetBlendEquation(GPU_Image* image, GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation); 986 + DECLSPEC void SDLCALL GPU_SetBlendEquation(GPU_Image* image, GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation); 985 987 986 988 /*! Sets the blending mode, if supported by the renderer. */ 987 - void GPU_SetBlendMode(GPU_Image* image, GPU_BlendPresetEnum mode); 989 + DECLSPEC void SDLCALL GPU_SetBlendMode(GPU_Image* image, GPU_BlendPresetEnum mode); 988 990 989 991 /*! Sets the image filtering mode, if supported by the renderer. */ 990 - void GPU_SetImageFilter(GPU_Image* image, GPU_FilterEnum filter); 992 + DECLSPEC void SDLCALL GPU_SetImageFilter(GPU_Image* image, GPU_FilterEnum filter); 991 993 992 994 /*! Gets the current pixel snap setting. The default value is GPU_SNAP_POSITION_AND_DIMENSIONS. */ 993 - GPU_SnapEnum GPU_GetSnapMode(GPU_Image* image); 995 + DECLSPEC GPU_SnapEnum SDLCALL GPU_GetSnapMode(GPU_Image* image); 994 996 995 997 /*! Sets the pixel grid snapping mode for the given image. */ 996 - void GPU_SetSnapMode(GPU_Image* image, GPU_SnapEnum mode); 998 + DECLSPEC void SDLCALL GPU_SetSnapMode(GPU_Image* image, GPU_SnapEnum mode); 997 999 998 1000 /*! Sets the image wrapping mode, if supported by the renderer. */ 999 - void GPU_SetWrapMode(GPU_Image* image, GPU_WrapEnum wrap_mode_x, GPU_WrapEnum wrap_mode_y); 1001 + DECLSPEC void SDLCALL GPU_SetWrapMode(GPU_Image* image, GPU_WrapEnum wrap_mode_x, GPU_WrapEnum wrap_mode_y); 1000 1002 1001 1003 // End of ImageControls 1002 1004 /*! @} */ ··· 1007 1009 * @{ */ 1008 1010 1009 1011 /*! Copy SDL_Surface data into a new GPU_Image. Don't forget to SDL_FreeSurface() the surface and GPU_FreeImage() the image.*/ 1010 - GPU_Image* GPU_CopyImageFromSurface(SDL_Surface* surface); 1012 + DECLSPEC GPU_Image* SDLCALL GPU_CopyImageFromSurface(SDL_Surface* surface); 1011 1013 1012 1014 /*! Copy GPU_Target data into a new GPU_Image. Don't forget to GPU_FreeImage() the image.*/ 1013 - GPU_Image* GPU_CopyImageFromTarget(GPU_Target* target); 1015 + DECLSPEC GPU_Image* SDLCALL GPU_CopyImageFromTarget(GPU_Target* target); 1014 1016 1015 1017 /*! Copy GPU_Target data into a new SDL_Surface. Don't forget to SDL_FreeSurface() the surface.*/ 1016 - SDL_Surface* GPU_CopySurfaceFromTarget(GPU_Target* target); 1018 + DECLSPEC SDL_Surface* SDLCALL GPU_CopySurfaceFromTarget(GPU_Target* target); 1017 1019 1018 1020 /*! Copy GPU_Image data into a new SDL_Surface. Don't forget to SDL_FreeSurface() the surface and GPU_FreeImage() the image.*/ 1019 - SDL_Surface* GPU_CopySurfaceFromImage(GPU_Image* image); 1021 + DECLSPEC SDL_Surface* SDLCALL GPU_CopySurfaceFromImage(GPU_Image* image); 1020 1022 1021 1023 // End of Conversions 1022 1024 /*! @} */ ··· 1032 1034 // Basic matrix operations (4x4) 1033 1035 1034 1036 /*! Copy matrix A to the given 'result' matrix. */ 1035 - void GPU_MatrixCopy(float* result, const float* A); 1037 + DECLSPEC void SDLCALL GPU_MatrixCopy(float* result, const float* A); 1036 1038 1037 1039 /*! Fills 'result' matrix with the identity matrix. */ 1038 - void GPU_MatrixIdentity(float* result); 1040 + DECLSPEC void SDLCALL GPU_MatrixIdentity(float* result); 1039 1041 1040 1042 /*! Multiplies matrices A and B and stores the result in the given 'result' matrix (result = A*B). Do not use A or B as 'result'. 1041 1043 * \see GPU_MultiplyAndAssign 1042 1044 */ 1043 - void GPU_Multiply4x4(float* result, float* A, float* B); 1045 + DECLSPEC void SDLCALL GPU_Multiply4x4(float* result, float* A, float* B); 1044 1046 1045 1047 /*! Multiplies matrices 'result' and A and stores the result in the given 'result' matrix (result = result * A). */ 1046 - void GPU_MultiplyAndAssign(float* result, float* A); 1048 + DECLSPEC void SDLCALL GPU_MultiplyAndAssign(float* result, float* A); 1047 1049 1048 1050 1049 1051 // Matrix stack accessors 1050 1052 1051 1053 /*! Returns an internal string that represents the contents of matrix A. */ 1052 - const char* GPU_GetMatrixString(float* A); 1054 + DECLSPEC const char* SDLCALL GPU_GetMatrixString(float* A); 1053 1055 1054 1056 /*! Returns the current matrix from the top of the matrix stack. Returns NULL if stack is empty. */ 1055 - float* GPU_GetCurrentMatrix(void); 1057 + DECLSPEC float* SDLCALL GPU_GetCurrentMatrix(void); 1056 1058 1057 1059 /*! Returns the current modelview matrix from the top of the matrix stack. Returns NULL if stack is empty. */ 1058 - float* GPU_GetModelView(void); 1060 + DECLSPEC float* SDLCALL GPU_GetModelView(void); 1059 1061 1060 1062 /*! Returns the current projection matrix from the top of the matrix stack. Returns NULL if stack is empty. */ 1061 - float* GPU_GetProjection(void); 1063 + DECLSPEC float* SDLCALL GPU_GetProjection(void); 1062 1064 1063 1065 /*! Copies the current modelview-projection matrix into the given 'result' matrix (result = P*M). */ 1064 - void GPU_GetModelViewProjection(float* result); 1066 + DECLSPEC void SDLCALL GPU_GetModelViewProjection(float* result); 1065 1067 1066 1068 1067 1069 // Matrix stack manipulators 1068 1070 1069 1071 /*! Changes matrix mode to either GPU_PROJECTION or GPU_MODELVIEW. Further matrix stack operations manipulate that particular stack. */ 1070 - void GPU_MatrixMode(int matrix_mode); 1072 + DECLSPEC void SDLCALL GPU_MatrixMode(int matrix_mode); 1071 1073 1072 1074 /*! Pushes the current matrix as a new matrix stack item. */ 1073 - void GPU_PushMatrix(void); 1075 + DECLSPEC void SDLCALL GPU_PushMatrix(void); 1074 1076 1075 1077 /*! Removes the current matrix from the stack. */ 1076 - void GPU_PopMatrix(void); 1078 + DECLSPEC void SDLCALL GPU_PopMatrix(void); 1077 1079 1078 1080 /*! Fills current matrix with the identity matrix. */ 1079 - void GPU_LoadIdentity(void); 1081 + DECLSPEC void SDLCALL GPU_LoadIdentity(void); 1080 1082 1081 1083 /*! Multiplies an orthographic projection matrix into the current matrix. */ 1082 - void GPU_Ortho(float left, float right, float bottom, float top, float near, float far); 1084 + DECLSPEC void SDLCALL GPU_Ortho(float left, float right, float bottom, float top, float near, float far); 1083 1085 1084 1086 /*! Multiplies a perspective projection matrix into the current matrix. */ 1085 - void GPU_Frustum(float right, float left, float bottom, float top, float near, float far); 1087 + DECLSPEC void SDLCALL GPU_Frustum(float right, float left, float bottom, float top, float near, float far); 1086 1088 1087 1089 /*! Adds a translation into the current matrix. */ 1088 - void GPU_Translate(float x, float y, float z); 1090 + DECLSPEC void SDLCALL GPU_Translate(float x, float y, float z); 1089 1091 1090 1092 /*! Multiplies a scaling matrix into the current matrix. */ 1091 - void GPU_Scale(float sx, float sy, float sz); 1093 + DECLSPEC void SDLCALL GPU_Scale(float sx, float sy, float sz); 1092 1094 1093 1095 /*! Multiplies a rotation matrix into the current matrix. */ 1094 - void GPU_Rotate(float degrees, float x, float y, float z); 1096 + DECLSPEC void SDLCALL GPU_Rotate(float degrees, float x, float y, float z); 1095 1097 1096 1098 /*! Multiplies a given matrix into the current matrix. */ 1097 - void GPU_MultMatrix(float* matrix4x4); 1099 + DECLSPEC void SDLCALL GPU_MultMatrix(float* matrix4x4); 1098 1100 1099 1101 // End of Matrix 1100 1102 /*! @} */ ··· 1108 1110 * @{ */ 1109 1111 1110 1112 /*! Clears the contents of the given render target. Fills the target with color {0, 0, 0, 0}. */ 1111 - void GPU_Clear(GPU_Target* target); 1113 + DECLSPEC void SDLCALL GPU_Clear(GPU_Target* target); 1112 1114 1113 1115 /*! Fills the given render target with a color. */ 1114 - void GPU_ClearColor(GPU_Target* target, SDL_Color color); 1116 + DECLSPEC void SDLCALL GPU_ClearColor(GPU_Target* target, SDL_Color color); 1115 1117 1116 1118 /*! Fills the given render target with a color (alpha is 255, fully opaque). */ 1117 - void GPU_ClearRGB(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b); 1119 + DECLSPEC void SDLCALL GPU_ClearRGB(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b); 1118 1120 1119 1121 /*! Fills the given render target with a color. */ 1120 - void GPU_ClearRGBA(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 1122 + DECLSPEC void SDLCALL GPU_ClearRGBA(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 1121 1123 1122 1124 /*! Draws the given image to the given render target. 1123 1125 * \param src_rect The region of the source image to use. 1124 1126 * \param x Destination x-position 1125 1127 * \param y Destination y-position */ 1126 - void GPU_Blit(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y); 1128 + DECLSPEC void SDLCALL GPU_Blit(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y); 1127 1129 1128 1130 /*! Rotates and draws the given image to the given render target. 1129 1131 * \param src_rect The region of the source image to use. 1130 1132 * \param x Destination x-position 1131 1133 * \param y Destination y-position 1132 1134 * \param degrees Rotation angle (in degrees) */ 1133 - void GPU_BlitRotate(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float degrees); 1135 + DECLSPEC void SDLCALL GPU_BlitRotate(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float degrees); 1134 1136 1135 1137 /*! Scales and draws the given image to the given render target. 1136 1138 * \param src_rect The region of the source image to use. ··· 1138 1140 * \param y Destination y-position 1139 1141 * \param scaleX Horizontal stretch factor 1140 1142 * \param scaleY Vertical stretch factor */ 1141 - void GPU_BlitScale(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float scaleX, float scaleY); 1143 + DECLSPEC void SDLCALL GPU_BlitScale(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float scaleX, float scaleY); 1142 1144 1143 1145 /*! Scales, rotates, and draws the given image to the given render target. 1144 1146 * \param src_rect The region of the source image to use. ··· 1147 1149 * \param degrees Rotation angle (in degrees) 1148 1150 * \param scaleX Horizontal stretch factor 1149 1151 * \param scaleY Vertical stretch factor */ 1150 - void GPU_BlitTransform(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float degrees, float scaleX, float scaleY); 1152 + DECLSPEC void SDLCALL GPU_BlitTransform(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float degrees, float scaleX, float scaleY); 1151 1153 1152 1154 /*! Scales, rotates around a pivot point, and draws the given image to the given render target. The drawing point (x, y) coincides with the pivot point on the src image (pivot_x, pivot_y). 1153 1155 * \param src_rect The region of the source image to use. ··· 1158 1160 * \param degrees Rotation angle (in degrees) 1159 1161 * \param scaleX Horizontal stretch factor 1160 1162 * \param scaleY Vertical stretch factor */ 1161 - void GPU_BlitTransformX(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float pivot_x, float pivot_y, float degrees, float scaleX, float scaleY); 1163 + DECLSPEC void SDLCALL GPU_BlitTransformX(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float pivot_x, float pivot_y, float degrees, float scaleX, float scaleY); 1162 1164 1163 1165 /*! Transforms and draws the given image to the given render target. 1164 1166 * \param src_rect The region of the source image to use. 1165 1167 * \param x Destination x-position 1166 1168 * \param y Destination y-position 1167 1169 * \param matrix3x3 3x3 matrix in column-major order (index = row + column*numColumns) */ 1168 - void GPU_BlitTransformMatrix(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float* matrix3x3); 1170 + DECLSPEC void SDLCALL GPU_BlitTransformMatrix(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float* matrix3x3); 1169 1171 1170 1172 /*! Performs 'num_sprites' blits of the given image to the given target. 1171 1173 * Note: GPU_BlitBatch() cannot interpret a mix of normal values and "passthrough" values due to format ambiguity. 1172 1174 * \param values A tightly-packed array of position (x,y), src_rect (x,y,w,h) values in image coordinates, and color (r,g,b,a) values with a range from 0-255. Pass NULL to render with only custom shader attributes. 1173 1175 * \param flags Bit flags to control the interpretation of the array parameters. The only passthrough option accepted is GPU_PASSTHROUGH_ALL. 1174 1176 */ 1175 - void GPU_BlitBatch(GPU_Image* image, GPU_Target* target, unsigned int num_sprites, float* values, GPU_BlitFlagEnum flags); 1177 + DECLSPEC void SDLCALL GPU_BlitBatch(GPU_Image* image, GPU_Target* target, unsigned int num_sprites, float* values, GPU_BlitFlagEnum flags); 1176 1178 1177 1179 /*! Performs 'num_sprites' blits of the given image to the given target. 1178 1180 * \param positions A tightly-packed array of (x,y) values ··· 1180 1182 * \param colors A tightly-packed array of (r,g,b,a) values with a range from 0-255 1181 1183 * \param flags Bit flags to control the interpretation of the array parameters 1182 1184 */ 1183 - void GPU_BlitBatchSeparate(GPU_Image* image, GPU_Target* target, unsigned int num_sprites, float* positions, float* src_rects, float* colors, GPU_BlitFlagEnum flags); 1185 + DECLSPEC void SDLCALL GPU_BlitBatchSeparate(GPU_Image* image, GPU_Target* target, unsigned int num_sprites, float* positions, float* src_rects, float* colors, GPU_BlitFlagEnum flags); 1184 1186 1185 1187 /*! Renders triangles from the given set of vertices. This lets you render arbitrary 2D geometry. 1186 1188 * \param values A tightly-packed array of vertex position (x,y), image coordinates (s,t), and color (r,g,b,a) values with a range from 0-255. Pass NULL to render with only custom shader attributes. 1187 1189 * \param indices If not NULL, this is used to specify which vertices to use and in what order (i.e. it indexes the vertices in the 'values' array). 1188 1190 * \param flags Bit flags to control the interpretation of the array parameters. Since 'values' contains per-vertex data, GPU_PASSTHROUGH_VERTICES is ignored. Texture coordinates are scaled down using the image dimensions and color components are normalized to [0.0, 1.0]. 1189 1191 */ 1190 - void GPU_TriangleBatch(GPU_Image* image, GPU_Target* target, unsigned short num_vertices, float* values, unsigned int num_indices, unsigned short* indices, GPU_BlitFlagEnum flags); 1192 + DECLSPEC void SDLCALL GPU_TriangleBatch(GPU_Image* image, GPU_Target* target, unsigned short num_vertices, float* values, unsigned int num_indices, unsigned short* indices, GPU_BlitFlagEnum flags); 1191 1193 1192 1194 /*! Send all buffered blitting data to the current context target. */ 1193 - void GPU_FlushBlitBuffer(void); 1195 + DECLSPEC void SDLCALL GPU_FlushBlitBuffer(void); 1194 1196 1195 1197 /*! Updates the given target's associated window. */ 1196 - void GPU_Flip(GPU_Target* target); 1198 + DECLSPEC void SDLCALL GPU_Flip(GPU_Target* target); 1197 1199 1198 1200 // End of Rendering 1199 1201 /*! @} */ ··· 1211 1213 * \param y y-coord of the point 1212 1214 * \param color The color of the shape to render 1213 1215 */ 1214 - void GPU_Pixel(GPU_Target* target, float x, float y, SDL_Color color); 1216 + DECLSPEC void SDLCALL GPU_Pixel(GPU_Target* target, float x, float y, SDL_Color color); 1215 1217 1216 1218 /*! Renders a colored line. 1217 1219 * \param target The destination render target ··· 1221 1223 * \param y2 y-coord of ending point 1222 1224 * \param color The color of the shape to render 1223 1225 */ 1224 - void GPU_Line(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); 1226 + DECLSPEC void SDLCALL GPU_Line(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); 1225 1227 1226 1228 /*! Renders a colored arc curve (circle segment). 1227 1229 * \param target The destination render target ··· 1232 1234 * \param end_angle The angle to end at, in degrees. Measured clockwise from the positive x-axis. 1233 1235 * \param color The color of the shape to render 1234 1236 */ 1235 - void GPU_Arc(GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color); 1237 + DECLSPEC void SDLCALL GPU_Arc(GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color); 1236 1238 1237 1239 /*! Renders a colored filled arc (circle segment / pie piece). 1238 1240 * \param target The destination render target ··· 1243 1245 * \param end_angle The angle to end at, in degrees. Measured clockwise from the positive x-axis. 1244 1246 * \param color The color of the shape to render 1245 1247 */ 1246 - void GPU_ArcFilled(GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color); 1248 + DECLSPEC void SDLCALL GPU_ArcFilled(GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color); 1247 1249 1248 1250 /*! Renders a colored circle outline. 1249 1251 * \param target The destination render target ··· 1252 1254 * \param radius The radius of the circle / distance from the center point that rendering will occur 1253 1255 * \param color The color of the shape to render 1254 1256 */ 1255 - void GPU_Circle(GPU_Target* target, float x, float y, float radius, SDL_Color color); 1257 + DECLSPEC void SDLCALL GPU_Circle(GPU_Target* target, float x, float y, float radius, SDL_Color color); 1256 1258 1257 1259 /*! Renders a colored filled circle. 1258 1260 * \param target The destination render target ··· 1261 1263 * \param radius The radius of the circle / distance from the center point that rendering will occur 1262 1264 * \param color The color of the shape to render 1263 1265 */ 1264 - void GPU_CircleFilled(GPU_Target* target, float x, float y, float radius, SDL_Color color); 1266 + DECLSPEC void SDLCALL GPU_CircleFilled(GPU_Target* target, float x, float y, float radius, SDL_Color color); 1265 1267 1266 1268 /*! Renders a colored ellipse outline. 1267 1269 * \param target The destination render target ··· 1272 1274 * \param degrees The angle to rotate the ellipse 1273 1275 * \param color The color of the shape to render 1274 1276 */ 1275 - void GPU_Ellipse(GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color); 1277 + DECLSPEC void SDLCALL GPU_Ellipse(GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color); 1276 1278 1277 1279 /*! Renders a colored filled ellipse. 1278 1280 * \param target The destination render target ··· 1283 1285 * \param degrees The angle to rotate the ellipse 1284 1286 * \param color The color of the shape to render 1285 1287 */ 1286 - void GPU_EllipseFilled(GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color); 1288 + DECLSPEC void SDLCALL GPU_EllipseFilled(GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color); 1287 1289 1288 1290 /*! Renders a colored annular sector outline (ring segment). 1289 1291 * \param target The destination render target ··· 1295 1297 * \param end_angle The angle to end at, in degrees. Measured clockwise from the positive x-axis. 1296 1298 * \param color The color of the shape to render 1297 1299 */ 1298 - void GPU_Sector(GPU_Target* target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color); 1300 + DECLSPEC void SDLCALL GPU_Sector(GPU_Target* target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color); 1299 1301 1300 1302 /*! Renders a colored filled annular sector (ring segment). 1301 1303 * \param target The destination render target ··· 1307 1309 * \param end_angle The angle to end at, in degrees. Measured clockwise from the positive x-axis. 1308 1310 * \param color The color of the shape to render 1309 1311 */ 1310 - void GPU_SectorFilled(GPU_Target* target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color); 1312 + DECLSPEC void SDLCALL GPU_SectorFilled(GPU_Target* target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color); 1311 1313 1312 1314 /*! Renders a colored triangle outline. 1313 1315 * \param target The destination render target ··· 1319 1321 * \param y3 y-coord of third point 1320 1322 * \param color The color of the shape to render 1321 1323 */ 1322 - void GPU_Tri(GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color); 1324 + DECLSPEC void SDLCALL GPU_Tri(GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color); 1323 1325 1324 1326 /*! Renders a colored filled triangle. 1325 1327 * \param target The destination render target ··· 1331 1333 * \param y3 y-coord of third point 1332 1334 * \param color The color of the shape to render 1333 1335 */ 1334 - void GPU_TriFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color); 1336 + DECLSPEC void SDLCALL GPU_TriFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color); 1335 1337 1336 1338 /*! Renders a colored rectangle outline. 1337 1339 * \param target The destination render target ··· 1341 1343 * \param y2 y-coord of bottom-right corner 1342 1344 * \param color The color of the shape to render 1343 1345 */ 1344 - void GPU_Rectangle(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); 1346 + DECLSPEC void SDLCALL GPU_Rectangle(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); 1345 1347 1346 1348 /*! Renders a colored filled rectangle. 1347 1349 * \param target The destination render target ··· 1351 1353 * \param y2 y-coord of bottom-right corner 1352 1354 * \param color The color of the shape to render 1353 1355 */ 1354 - void GPU_RectangleFilled(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); 1356 + DECLSPEC void SDLCALL GPU_RectangleFilled(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); 1355 1357 1356 1358 /*! Renders a colored rounded (filleted) rectangle outline. 1357 1359 * \param target The destination render target ··· 1362 1364 * \param radius The radius of the corners 1363 1365 * \param color The color of the shape to render 1364 1366 */ 1365 - void GPU_RectangleRound(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color); 1367 + DECLSPEC void SDLCALL GPU_RectangleRound(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color); 1366 1368 1367 1369 /*! Renders a colored filled rounded (filleted) rectangle. 1368 1370 * \param target The destination render target ··· 1373 1375 * \param radius The radius of the corners 1374 1376 * \param color The color of the shape to render 1375 1377 */ 1376 - void GPU_RectangleRoundFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color); 1378 + DECLSPEC void SDLCALL GPU_RectangleRoundFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color); 1377 1379 1378 1380 /*! Renders a colored polygon outline. The vertices are expected to define a convex polygon. 1379 1381 * \param target The destination render target ··· 1381 1383 * \param vertices An array of vertex positions stored as interlaced x and y coords, e.g. {x1, y1, x2, y2, ...} 1382 1384 * \param color The color of the shape to render 1383 1385 */ 1384 - void GPU_Polygon(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color); 1386 + DECLSPEC void SDLCALL GPU_Polygon(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color); 1385 1387 1386 1388 /*! Renders a colored filled polygon. The vertices are expected to define a convex polygon. 1387 1389 * \param target The destination render target ··· 1389 1391 * \param vertices An array of vertex positions stored as interlaced x and y coords, e.g. {x1, y1, x2, y2, ...} 1390 1392 * \param color The color of the shape to render 1391 1393 */ 1392 - void GPU_PolygonFilled(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color); 1394 + DECLSPEC void SDLCALL GPU_PolygonFilled(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color); 1393 1395 1394 1396 // End of Shapes 1395 1397 /*! @} */ ··· 1405 1407 * \see GPU_AttachShader 1406 1408 * \see GPU_LinkShaderProgram 1407 1409 */ 1408 - Uint32 GPU_CreateShaderProgram(void); 1410 + DECLSPEC Uint32 SDLCALL GPU_CreateShaderProgram(void); 1409 1411 1410 1412 /*! Deletes a shader program. */ 1411 - void GPU_FreeShaderProgram(Uint32 program_object); 1413 + DECLSPEC void SDLCALL GPU_FreeShaderProgram(Uint32 program_object); 1412 1414 1413 1415 /*! Loads shader source from an SDL_RWops, compiles it, and returns the new shader object. */ 1414 - Uint32 GPU_CompileShader_RW(GPU_ShaderEnum shader_type, SDL_RWops* shader_source); 1416 + DECLSPEC Uint32 SDLCALL GPU_CompileShader_RW(GPU_ShaderEnum shader_type, SDL_RWops* shader_source); 1415 1417 1416 1418 /*! Compiles shader source and returns the new shader object. */ 1417 - Uint32 GPU_CompileShader(GPU_ShaderEnum shader_type, const char* shader_source); 1419 + DECLSPEC Uint32 SDLCALL GPU_CompileShader(GPU_ShaderEnum shader_type, const char* shader_source); 1418 1420 1419 1421 /*! Loads shader source from a file, compiles it, and returns the new shader object. */ 1420 - Uint32 GPU_LoadShader(GPU_ShaderEnum shader_type, const char* filename); 1422 + DECLSPEC Uint32 SDLCALL GPU_LoadShader(GPU_ShaderEnum shader_type, const char* filename); 1421 1423 1422 1424 /*! Creates and links a shader program with the given shader objects. */ 1423 - Uint32 GPU_LinkShaders(Uint32 shader_object1, Uint32 shader_object2); 1425 + DECLSPEC Uint32 SDLCALL GPU_LinkShaders(Uint32 shader_object1, Uint32 shader_object2); 1424 1426 1425 1427 /*! Deletes a shader object. */ 1426 - void GPU_FreeShader(Uint32 shader_object); 1428 + DECLSPEC void SDLCALL GPU_FreeShader(Uint32 shader_object); 1427 1429 1428 1430 /*! Attaches a shader object to a shader program for future linking. */ 1429 - void GPU_AttachShader(Uint32 program_object, Uint32 shader_object); 1431 + DECLSPEC void SDLCALL GPU_AttachShader(Uint32 program_object, Uint32 shader_object); 1430 1432 1431 1433 /*! Detaches a shader object from a shader program. */ 1432 - void GPU_DetachShader(Uint32 program_object, Uint32 shader_object); 1434 + DECLSPEC void SDLCALL GPU_DetachShader(Uint32 program_object, Uint32 shader_object); 1433 1435 1434 1436 /*! Links a shader program with any attached shader objects. */ 1435 - Uint8 GPU_LinkShaderProgram(Uint32 program_object); 1437 + DECLSPEC Uint8 SDLCALL GPU_LinkShaderProgram(Uint32 program_object); 1436 1438 1437 1439 /*! \return The current shader program */ 1438 - Uint32 GPU_GetCurrentShaderProgram(void); 1440 + DECLSPEC Uint32 SDLCALL GPU_GetCurrentShaderProgram(void); 1439 1441 1440 1442 /*! Returns 1 if the given shader program is a default shader for the current context, 0 otherwise. */ 1441 - Uint8 GPU_IsDefaultShaderProgram(Uint32 program_object); 1443 + DECLSPEC Uint8 SDLCALL GPU_IsDefaultShaderProgram(Uint32 program_object); 1442 1444 1443 1445 /*! Activates the given shader program. Passing NULL for 'block' will disable the built-in shader variables for custom shaders until a GPU_ShaderBlock is set again. */ 1444 - void GPU_ActivateShaderProgram(Uint32 program_object, GPU_ShaderBlock* block); 1446 + DECLSPEC void SDLCALL GPU_ActivateShaderProgram(Uint32 program_object, GPU_ShaderBlock* block); 1445 1447 1446 1448 /*! Deactivates the current shader program (activates program 0). */ 1447 - void GPU_DeactivateShaderProgram(void); 1449 + DECLSPEC void SDLCALL GPU_DeactivateShaderProgram(void); 1448 1450 1449 1451 /*! Returns the last shader log message. */ 1450 - const char* GPU_GetShaderMessage(void); 1452 + DECLSPEC const char* SDLCALL GPU_GetShaderMessage(void); 1451 1453 1452 1454 /*! Returns an integer representing the location of the specified attribute shader variable. */ 1453 - int GPU_GetAttributeLocation(Uint32 program_object, const char* attrib_name); 1455 + DECLSPEC int SDLCALL GPU_GetAttributeLocation(Uint32 program_object, const char* attrib_name); 1454 1456 1455 1457 /*! Returns a filled GPU_AttributeFormat object. */ 1456 - GPU_AttributeFormat GPU_MakeAttributeFormat(int num_elems_per_vertex, GPU_TypeEnum type, Uint8 normalize, int stride_bytes, int offset_bytes); 1458 + DECLSPEC GPU_AttributeFormat SDLCALL GPU_MakeAttributeFormat(int num_elems_per_vertex, GPU_TypeEnum type, Uint8 normalize, int stride_bytes, int offset_bytes); 1457 1459 1458 1460 /*! Returns a filled GPU_Attribute object. */ 1459 - GPU_Attribute GPU_MakeAttribute(int location, void* values, GPU_AttributeFormat format); 1461 + DECLSPEC GPU_Attribute SDLCALL GPU_MakeAttribute(int location, void* values, GPU_AttributeFormat format); 1460 1462 1461 1463 /*! Returns an integer representing the location of the specified uniform shader variable. */ 1462 - int GPU_GetUniformLocation(Uint32 program_object, const char* uniform_name); 1464 + DECLSPEC int SDLCALL GPU_GetUniformLocation(Uint32 program_object, const char* uniform_name); 1463 1465 1464 1466 /*! Loads the given shader program's built-in attribute and uniform locations. */ 1465 - GPU_ShaderBlock GPU_LoadShaderBlock(Uint32 program_object, const char* position_name, const char* texcoord_name, const char* color_name, const char* modelViewMatrix_name); 1467 + DECLSPEC GPU_ShaderBlock SDLCALL GPU_LoadShaderBlock(Uint32 program_object, const char* position_name, const char* texcoord_name, const char* color_name, const char* modelViewMatrix_name); 1466 1468 1467 1469 /*! Sets the current shader block to use the given attribute and uniform locations. */ 1468 - void GPU_SetShaderBlock(GPU_ShaderBlock block); 1470 + DECLSPEC void SDLCALL GPU_SetShaderBlock(GPU_ShaderBlock block); 1469 1471 1470 1472 /*! Sets the given image unit to the given image so that a custom shader can sample multiple textures. 1471 1473 \param image The source image/texture. Pass NULL to disable the image unit. 1472 1474 \param location The uniform location of a texture sampler 1473 1475 \param image_unit The index of the texture unit to set. 0 is the first unit, which is used by SDL_gpu's blitting functions. 1 would be the second unit. */ 1474 - void GPU_SetShaderImage(GPU_Image* image, int location, int image_unit); 1476 + DECLSPEC void SDLCALL GPU_SetShaderImage(GPU_Image* image, int location, int image_unit); 1475 1477 1476 1478 /*! Fills "values" with the value of the uniform shader variable at the given location. */ 1477 - void GPU_GetUniformiv(Uint32 program_object, int location, int* values); 1479 + DECLSPEC void SDLCALL GPU_GetUniformiv(Uint32 program_object, int location, int* values); 1478 1480 1479 1481 /*! Sets the value of the integer uniform shader variable at the given location. 1480 1482 This is equivalent to calling GPU_SetUniformiv(location, 1, 1, &value). */ 1481 - void GPU_SetUniformi(int location, int value); 1483 + DECLSPEC void SDLCALL GPU_SetUniformi(int location, int value); 1482 1484 1483 1485 /*! Sets the value of the integer uniform shader variable at the given location. */ 1484 - void GPU_SetUniformiv(int location, int num_elements_per_value, int num_values, int* values); 1486 + DECLSPEC void SDLCALL GPU_SetUniformiv(int location, int num_elements_per_value, int num_values, int* values); 1485 1487 1486 1488 /*! Fills "values" with the value of the uniform shader variable at the given location. */ 1487 - void GPU_GetUniformuiv(Uint32 program_object, int location, unsigned int* values); 1489 + DECLSPEC void SDLCALL GPU_GetUniformuiv(Uint32 program_object, int location, unsigned int* values); 1488 1490 1489 1491 /*! Sets the value of the unsigned integer uniform shader variable at the given location. 1490 1492 This is equivalent to calling GPU_SetUniformuiv(location, 1, 1, &value). */ 1491 - void GPU_SetUniformui(int location, unsigned int value); 1493 + DECLSPEC void SDLCALL GPU_SetUniformui(int location, unsigned int value); 1492 1494 1493 1495 /*! Sets the value of the unsigned integer uniform shader variable at the given location. */ 1494 - void GPU_SetUniformuiv(int location, int num_elements_per_value, int num_values, unsigned int* values); 1496 + DECLSPEC void SDLCALL GPU_SetUniformuiv(int location, int num_elements_per_value, int num_values, unsigned int* values); 1495 1497 1496 1498 /*! Fills "values" with the value of the uniform shader variable at the given location. */ 1497 - void GPU_GetUniformfv(Uint32 program_object, int location, float* values); 1499 + DECLSPEC void SDLCALL GPU_GetUniformfv(Uint32 program_object, int location, float* values); 1498 1500 1499 1501 /*! Sets the value of the floating point uniform shader variable at the given location. 1500 1502 This is equivalent to calling GPU_SetUniformfv(location, 1, 1, &value). */ 1501 - void GPU_SetUniformf(int location, float value); 1503 + DECLSPEC void SDLCALL GPU_SetUniformf(int location, float value); 1502 1504 1503 1505 /*! Sets the value of the floating point uniform shader variable at the given location. */ 1504 - void GPU_SetUniformfv(int location, int num_elements_per_value, int num_values, float* values); 1506 + DECLSPEC void SDLCALL GPU_SetUniformfv(int location, int num_elements_per_value, int num_values, float* values); 1505 1507 1506 1508 /*! Fills "values" with the value of the uniform shader variable at the given location. The results are identical to calling GPU_GetUniformfv(). Matrices are gotten in column-major order. */ 1507 - void GPU_GetUniformMatrixfv(Uint32 program_object, int location, float* values); 1509 + DECLSPEC void SDLCALL GPU_GetUniformMatrixfv(Uint32 program_object, int location, float* values); 1508 1510 1509 1511 /*! Sets the value of the matrix uniform shader variable at the given location. The size of the matrices sent is specified by num_rows and num_columns. Rows and columns must be between 2 and 4. */ 1510 - void GPU_SetUniformMatrixfv(int location, int num_matrices, int num_rows, int num_columns, Uint8 transpose, float* values); 1512 + DECLSPEC void SDLCALL GPU_SetUniformMatrixfv(int location, int num_matrices, int num_rows, int num_columns, Uint8 transpose, float* values); 1511 1513 1512 1514 /*! Sets a constant-value shader attribute that will be used for each rendered vertex. */ 1513 - void GPU_SetAttributef(int location, float value); 1515 + DECLSPEC void SDLCALL GPU_SetAttributef(int location, float value); 1514 1516 1515 1517 /*! Sets a constant-value shader attribute that will be used for each rendered vertex. */ 1516 - void GPU_SetAttributei(int location, int value); 1518 + DECLSPEC void SDLCALL GPU_SetAttributei(int location, int value); 1517 1519 1518 1520 /*! Sets a constant-value shader attribute that will be used for each rendered vertex. */ 1519 - void GPU_SetAttributeui(int location, unsigned int value); 1521 + DECLSPEC void SDLCALL GPU_SetAttributeui(int location, unsigned int value); 1520 1522 1521 1523 /*! Sets a constant-value shader attribute that will be used for each rendered vertex. */ 1522 - void GPU_SetAttributefv(int location, int num_elements, float* value); 1524 + DECLSPEC void SDLCALL GPU_SetAttributefv(int location, int num_elements, float* value); 1523 1525 1524 1526 /*! Sets a constant-value shader attribute that will be used for each rendered vertex. */ 1525 - void GPU_SetAttributeiv(int location, int num_elements, int* value); 1527 + DECLSPEC void SDLCALL GPU_SetAttributeiv(int location, int num_elements, int* value); 1526 1528 1527 1529 /*! Sets a constant-value shader attribute that will be used for each rendered vertex. */ 1528 - void GPU_SetAttributeuiv(int location, int num_elements, unsigned int* value); 1530 + DECLSPEC void SDLCALL GPU_SetAttributeuiv(int location, int num_elements, unsigned int* value); 1529 1531 1530 1532 /*! Enables a shader attribute and sets its source data. */ 1531 - void GPU_SetAttributeSource(int num_values, GPU_Attribute source); 1533 + DECLSPEC void SDLCALL GPU_SetAttributeSource(int num_values, GPU_Attribute source); 1532 1534 1533 1535 // End of ShaderInterface 1534 1536 /*! @} */ ··· 1538 1540 } 1539 1541 #endif 1540 1542 1543 + #include "close_code.h" 1541 1544 1542 1545 1543 1546 #endif
+101 -101
SDL_gpu/SDL_gpu_RendererImpl.h
··· 8 8 #endif 9 9 10 10 // Internal API for managing window mappings 11 - void GPU_AddWindowMapping(GPU_Target* target); 12 - void GPU_RemoveWindowMapping(Uint32 windowID); 13 - void GPU_RemoveWindowMappingByTarget(GPU_Target* target); 11 + DECLSPEC void SDLCALL GPU_AddWindowMapping(GPU_Target* target); 12 + DECLSPEC void SDLCALL GPU_RemoveWindowMapping(Uint32 windowID); 13 + DECLSPEC void SDLCALL GPU_RemoveWindowMappingByTarget(GPU_Target* target); 14 14 15 15 /*! Private implementation of renderer members. */ 16 16 typedef struct GPU_RendererImpl ··· 19 19 * \see GPU_InitRenderer() 20 20 * \see GPU_InitRendererByID() 21 21 */ 22 - GPU_Target* (*Init)(GPU_Renderer* renderer, GPU_RendererID renderer_request, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags); 22 + GPU_Target* (SDLCALL *Init)(GPU_Renderer* renderer, GPU_RendererID renderer_request, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags); 23 23 24 24 /*! \see GPU_CreateTargetFromWindow 25 25 * The extra parameter is used internally to reuse/reinit a target. */ 26 - GPU_Target* (*CreateTargetFromWindow)(GPU_Renderer* renderer, Uint32 windowID, GPU_Target* target); 26 + GPU_Target* (SDLCALL *CreateTargetFromWindow)(GPU_Renderer* renderer, Uint32 windowID, GPU_Target* target); 27 27 28 28 /*! \see GPU_CreateAliasTarget() */ 29 - GPU_Target* (*CreateAliasTarget)(GPU_Renderer* renderer, GPU_Target* target); 29 + GPU_Target* (SDLCALL *CreateAliasTarget)(GPU_Renderer* renderer, GPU_Target* target); 30 30 31 31 /*! \see GPU_MakeCurrent */ 32 - void (*MakeCurrent)(GPU_Renderer* renderer, GPU_Target* target, Uint32 windowID); 32 + void (SDLCALL *MakeCurrent)(GPU_Renderer* renderer, GPU_Target* target, Uint32 windowID); 33 33 34 34 /*! Sets up this renderer to act as the current renderer. Called automatically by GPU_SetCurrentRenderer(). */ 35 - void (*SetAsCurrent)(GPU_Renderer* renderer); 35 + void (SDLCALL *SetAsCurrent)(GPU_Renderer* renderer); 36 36 37 37 /*! \see GPU_ResetRendererState() */ 38 - void (*ResetRendererState)(GPU_Renderer* renderer); 38 + void (SDLCALL *ResetRendererState)(GPU_Renderer* renderer); 39 39 40 40 /*! \see GPU_SetWindowResolution() */ 41 - Uint8 (*SetWindowResolution)(GPU_Renderer* renderer, Uint16 w, Uint16 h); 41 + Uint8 (SDLCALL *SetWindowResolution)(GPU_Renderer* renderer, Uint16 w, Uint16 h); 42 42 43 43 /*! \see GPU_SetVirtualResolution() */ 44 - void (*SetVirtualResolution)(GPU_Renderer* renderer, GPU_Target* target, Uint16 w, Uint16 h); 44 + void (SDLCALL *SetVirtualResolution)(GPU_Renderer* renderer, GPU_Target* target, Uint16 w, Uint16 h); 45 45 46 46 /*! \see GPU_UnsetVirtualResolution() */ 47 - void (*UnsetVirtualResolution)(GPU_Renderer* renderer, GPU_Target* target); 47 + void (SDLCALL *UnsetVirtualResolution)(GPU_Renderer* renderer, GPU_Target* target); 48 48 49 49 /*! Clean up the renderer state. */ 50 - void (*Quit)(GPU_Renderer* renderer); 50 + void (SDLCALL *Quit)(GPU_Renderer* renderer); 51 51 52 52 /*! \see GPU_SetFullscreen() */ 53 - Uint8 (*SetFullscreen)(GPU_Renderer* renderer, Uint8 enable_fullscreen, Uint8 use_desktop_resolution); 53 + Uint8 (SDLCALL *SetFullscreen)(GPU_Renderer* renderer, Uint8 enable_fullscreen, Uint8 use_desktop_resolution); 54 54 55 55 /*! \see GPU_SetCamera() */ 56 - GPU_Camera (*SetCamera)(GPU_Renderer* renderer, GPU_Target* target, GPU_Camera* cam); 56 + GPU_Camera (SDLCALL *SetCamera)(GPU_Renderer* renderer, GPU_Target* target, GPU_Camera* cam); 57 57 58 58 /*! \see GPU_CreateImage() */ 59 - GPU_Image* (*CreateImage)(GPU_Renderer* renderer, Uint16 w, Uint16 h, GPU_FormatEnum format); 59 + GPU_Image* (SDLCALL *CreateImage)(GPU_Renderer* renderer, Uint16 w, Uint16 h, GPU_FormatEnum format); 60 60 61 61 /*! \see GPU_CreateImageUsingTexture() */ 62 - GPU_Image* (*CreateImageUsingTexture)(GPU_Renderer* renderer, Uint32 handle, Uint8 take_ownership); 62 + GPU_Image* (SDLCALL *CreateImageUsingTexture)(GPU_Renderer* renderer, Uint32 handle, Uint8 take_ownership); 63 63 64 64 /*! \see GPU_LoadImage() */ 65 - GPU_Image* (*LoadImage)(GPU_Renderer* renderer, const char* filename); 65 + GPU_Image* (SDLCALL *LoadImage)(GPU_Renderer* renderer, const char* filename); 66 66 67 67 /*! \see GPU_CreateAliasImage() */ 68 - GPU_Image* (*CreateAliasImage)(GPU_Renderer* renderer, GPU_Image* image); 68 + GPU_Image* (SDLCALL *CreateAliasImage)(GPU_Renderer* renderer, GPU_Image* image); 69 69 70 70 /*! \see GPU_SaveImage() */ 71 - Uint8 (*SaveImage)(GPU_Renderer* renderer, GPU_Image* image, const char* filename); 71 + Uint8 (SDLCALL *SaveImage)(GPU_Renderer* renderer, GPU_Image* image, const char* filename); 72 72 73 73 /*! \see GPU_CopyImage() */ 74 - GPU_Image* (*CopyImage)(GPU_Renderer* renderer, GPU_Image* image); 74 + GPU_Image* (SDLCALL *CopyImage)(GPU_Renderer* renderer, GPU_Image* image); 75 75 76 76 /*! \see GPU_UpdateImage */ 77 - void (*UpdateImage)(GPU_Renderer* renderer, GPU_Image* image, SDL_Surface* surface, const GPU_Rect* surface_rect); 77 + void (SDLCALL *UpdateImage)(GPU_Renderer* renderer, GPU_Image* image, SDL_Surface* surface, const GPU_Rect* surface_rect); 78 78 79 79 /*! \see GPU_UpdateSubImage */ 80 - void (*UpdateSubImage)(GPU_Renderer* renderer, GPU_Image* image, const GPU_Rect* image_rect, SDL_Surface* surface, const GPU_Rect* surface_rect); 80 + void (SDLCALL *UpdateSubImage)(GPU_Renderer* renderer, GPU_Image* image, const GPU_Rect* image_rect, SDL_Surface* surface, const GPU_Rect* surface_rect); 81 81 82 82 /*! \see GPU_UpdateImageBytes */ 83 - void (*UpdateImageBytes)(GPU_Renderer* renderer, GPU_Image* image, const GPU_Rect* image_rect, const unsigned char* bytes, int bytes_per_row); 83 + void (SDLCALL *UpdateImageBytes)(GPU_Renderer* renderer, GPU_Image* image, const GPU_Rect* image_rect, const unsigned char* bytes, int bytes_per_row); 84 84 85 85 /*! \see GPU_CopyImageFromSurface() */ 86 - GPU_Image* (*CopyImageFromSurface)(GPU_Renderer* renderer, SDL_Surface* surface); 86 + GPU_Image* (SDLCALL *CopyImageFromSurface)(GPU_Renderer* renderer, SDL_Surface* surface); 87 87 88 88 /*! \see GPU_CopyImageFromTarget() */ 89 - GPU_Image* (*CopyImageFromTarget)(GPU_Renderer* renderer, GPU_Target* target); 89 + GPU_Image* (SDLCALL *CopyImageFromTarget)(GPU_Renderer* renderer, GPU_Target* target); 90 90 91 91 /*! \see GPU_CopySurfaceFromTarget() */ 92 - SDL_Surface* (*CopySurfaceFromTarget)(GPU_Renderer* renderer, GPU_Target* target); 92 + SDL_Surface* (SDLCALL *CopySurfaceFromTarget)(GPU_Renderer* renderer, GPU_Target* target); 93 93 94 94 /*! \see GPU_CopySurfaceFromImage() */ 95 - SDL_Surface* (*CopySurfaceFromImage)(GPU_Renderer* renderer, GPU_Image* image); 95 + SDL_Surface* (SDLCALL *CopySurfaceFromImage)(GPU_Renderer* renderer, GPU_Image* image); 96 96 97 97 /*! \see GPU_FreeImage() */ 98 - void (*FreeImage)(GPU_Renderer* renderer, GPU_Image* image); 98 + void (SDLCALL *FreeImage)(GPU_Renderer* renderer, GPU_Image* image); 99 99 100 100 /*! \see GPU_LoadTarget() */ 101 - GPU_Target* (*LoadTarget)(GPU_Renderer* renderer, GPU_Image* image); 101 + GPU_Target* (SDLCALL *LoadTarget)(GPU_Renderer* renderer, GPU_Image* image); 102 102 103 103 /*! \see GPU_FreeTarget() */ 104 - void (*FreeTarget)(GPU_Renderer* renderer, GPU_Target* target); 104 + void (SDLCALL *FreeTarget)(GPU_Renderer* renderer, GPU_Target* target); 105 105 106 106 /*! \see GPU_Blit() */ 107 - void (*Blit)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y); 107 + void (SDLCALL *Blit)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y); 108 108 109 109 /*! \see GPU_BlitRotate() */ 110 - void (*BlitRotate)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float degrees); 110 + void (SDLCALL *BlitRotate)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float degrees); 111 111 112 112 /*! \see GPU_BlitScale() */ 113 - void (*BlitScale)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float scaleX, float scaleY); 113 + void (SDLCALL *BlitScale)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float scaleX, float scaleY); 114 114 115 115 /*! \see GPU_BlitTransform */ 116 - void (*BlitTransform)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float degrees, float scaleX, float scaleY); 116 + void (SDLCALL *BlitTransform)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float degrees, float scaleX, float scaleY); 117 117 118 118 /*! \see GPU_BlitTransformX() */ 119 - void (*BlitTransformX)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float pivot_x, float pivot_y, float degrees, float scaleX, float scaleY); 119 + void (SDLCALL *BlitTransformX)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float pivot_x, float pivot_y, float degrees, float scaleX, float scaleY); 120 120 121 121 /*! \see GPU_BlitTransformMatrix() */ 122 - void (*BlitTransformMatrix)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float* matrix3x3); 122 + void (SDLCALL *BlitTransformMatrix)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float* matrix3x3); 123 123 124 124 /*! \see GPU_BlitBatch() */ 125 - void (*BlitBatch)(GPU_Renderer* renderer, GPU_Image* image, GPU_Target* target, unsigned int num_sprites, float* values, GPU_BlitFlagEnum flags); 125 + void (SDLCALL *BlitBatch)(GPU_Renderer* renderer, GPU_Image* image, GPU_Target* target, unsigned int num_sprites, float* values, GPU_BlitFlagEnum flags); 126 126 127 127 /*! \see GPU_TriangleBatch() */ 128 - void (*TriangleBatch)(GPU_Renderer* renderer, GPU_Image* image, GPU_Target* target, unsigned short num_vertices, float* values, unsigned int num_indices, unsigned short* indices, GPU_BlitFlagEnum flags); 128 + void (SDLCALL *TriangleBatch)(GPU_Renderer* renderer, GPU_Image* image, GPU_Target* target, unsigned short num_vertices, float* values, unsigned int num_indices, unsigned short* indices, GPU_BlitFlagEnum flags); 129 129 130 130 /*! \see GPU_GenerateMipmaps() */ 131 - void (*GenerateMipmaps)(GPU_Renderer* renderer, GPU_Image* image); 131 + void (SDLCALL *GenerateMipmaps)(GPU_Renderer* renderer, GPU_Image* image); 132 132 133 133 /*! \see GPU_SetClip() */ 134 - GPU_Rect (*SetClip)(GPU_Renderer* renderer, GPU_Target* target, Sint16 x, Sint16 y, Uint16 w, Uint16 h); 134 + GPU_Rect (SDLCALL *SetClip)(GPU_Renderer* renderer, GPU_Target* target, Sint16 x, Sint16 y, Uint16 w, Uint16 h); 135 135 136 136 /*! \see GPU_UnsetClip() */ 137 - void (*UnsetClip)(GPU_Renderer* renderer, GPU_Target* target); 137 + void (SDLCALL *UnsetClip)(GPU_Renderer* renderer, GPU_Target* target); 138 138 139 139 /*! \see GPU_GetPixel() */ 140 - SDL_Color (*GetPixel)(GPU_Renderer* renderer, GPU_Target* target, Sint16 x, Sint16 y); 140 + SDL_Color (SDLCALL *GetPixel)(GPU_Renderer* renderer, GPU_Target* target, Sint16 x, Sint16 y); 141 141 142 142 /*! \see GPU_SetImageFilter() */ 143 - void (*SetImageFilter)(GPU_Renderer* renderer, GPU_Image* image, GPU_FilterEnum filter); 143 + void (SDLCALL *SetImageFilter)(GPU_Renderer* renderer, GPU_Image* image, GPU_FilterEnum filter); 144 144 145 145 /*! \see GPU_SetWrapMode() */ 146 - void (*SetWrapMode)(GPU_Renderer* renderer, GPU_Image* image, GPU_WrapEnum wrap_mode_x, GPU_WrapEnum wrap_mode_y); 146 + void (SDLCALL *SetWrapMode)(GPU_Renderer* renderer, GPU_Image* image, GPU_WrapEnum wrap_mode_x, GPU_WrapEnum wrap_mode_y); 147 147 148 148 /*! \see GPU_ClearRGBA() */ 149 - void (*ClearRGBA)(GPU_Renderer* renderer, GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 149 + void (SDLCALL *ClearRGBA)(GPU_Renderer* renderer, GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 150 150 /*! \see GPU_FlushBlitBuffer() */ 151 - void (*FlushBlitBuffer)(GPU_Renderer* renderer); 151 + void (SDLCALL *FlushBlitBuffer)(GPU_Renderer* renderer); 152 152 /*! \see GPU_Flip() */ 153 - void (*Flip)(GPU_Renderer* renderer, GPU_Target* target); 153 + void (SDLCALL *Flip)(GPU_Renderer* renderer, GPU_Target* target); 154 154 155 155 156 156 /*! \see GPU_CreateShaderProgram() */ 157 - Uint32 (*CreateShaderProgram)(GPU_Renderer* renderer); 157 + Uint32 (SDLCALL *CreateShaderProgram)(GPU_Renderer* renderer); 158 158 159 159 /*! \see GPU_FreeShaderProgram() */ 160 - void (*FreeShaderProgram)(GPU_Renderer* renderer, Uint32 program_object); 160 + void (SDLCALL *FreeShaderProgram)(GPU_Renderer* renderer, Uint32 program_object); 161 161 162 162 /*! \see GPU_CompileShader_RW() */ 163 - Uint32 (*CompileShader_RW)(GPU_Renderer* renderer, GPU_ShaderEnum shader_type, SDL_RWops* shader_source); 163 + Uint32 (SDLCALL *CompileShader_RW)(GPU_Renderer* renderer, GPU_ShaderEnum shader_type, SDL_RWops* shader_source); 164 164 165 165 /*! \see GPU_CompileShader() */ 166 - Uint32 (*CompileShader)(GPU_Renderer* renderer, GPU_ShaderEnum shader_type, const char* shader_source); 166 + Uint32 (SDLCALL *CompileShader)(GPU_Renderer* renderer, GPU_ShaderEnum shader_type, const char* shader_source); 167 167 168 168 /*! \see GPU_FreeShader() */ 169 - void (*FreeShader)(GPU_Renderer* renderer, Uint32 shader_object); 169 + void (SDLCALL *FreeShader)(GPU_Renderer* renderer, Uint32 shader_object); 170 170 171 171 /*! \see GPU_AttachShader() */ 172 - void (*AttachShader)(GPU_Renderer* renderer, Uint32 program_object, Uint32 shader_object); 172 + void (SDLCALL *AttachShader)(GPU_Renderer* renderer, Uint32 program_object, Uint32 shader_object); 173 173 174 174 /*! \see GPU_DetachShader() */ 175 - void (*DetachShader)(GPU_Renderer* renderer, Uint32 program_object, Uint32 shader_object); 175 + void (SDLCALL *DetachShader)(GPU_Renderer* renderer, Uint32 program_object, Uint32 shader_object); 176 176 177 177 /*! \see GPU_LinkShaderProgram() */ 178 - Uint8 (*LinkShaderProgram)(GPU_Renderer* renderer, Uint32 program_object); 178 + Uint8 (SDLCALL *LinkShaderProgram)(GPU_Renderer* renderer, Uint32 program_object); 179 179 180 180 /*! \see GPU_ActivateShaderProgram() */ 181 - void (*ActivateShaderProgram)(GPU_Renderer* renderer, Uint32 program_object, GPU_ShaderBlock* block); 181 + void (SDLCALL *ActivateShaderProgram)(GPU_Renderer* renderer, Uint32 program_object, GPU_ShaderBlock* block); 182 182 183 183 /*! \see GPU_DeactivateShaderProgram() */ 184 - void (*DeactivateShaderProgram)(GPU_Renderer* renderer); 184 + void (SDLCALL *DeactivateShaderProgram)(GPU_Renderer* renderer); 185 185 186 186 /*! \see GPU_GetShaderMessage() */ 187 - const char* (*GetShaderMessage)(GPU_Renderer* renderer); 187 + const char* (SDLCALL *GetShaderMessage)(GPU_Renderer* renderer); 188 188 189 189 /*! \see GPU_GetAttribLocation() */ 190 - int (*GetAttributeLocation)(GPU_Renderer* renderer, Uint32 program_object, const char* attrib_name); 190 + int (SDLCALL *GetAttributeLocation)(GPU_Renderer* renderer, Uint32 program_object, const char* attrib_name); 191 191 192 192 /*! \see GPU_GetUniformLocation() */ 193 - int (*GetUniformLocation)(GPU_Renderer* renderer, Uint32 program_object, const char* uniform_name); 193 + int (SDLCALL *GetUniformLocation)(GPU_Renderer* renderer, Uint32 program_object, const char* uniform_name); 194 194 195 195 /*! \see GPU_LoadShaderBlock() */ 196 - GPU_ShaderBlock (*LoadShaderBlock)(GPU_Renderer* renderer, Uint32 program_object, const char* position_name, const char* texcoord_name, const char* color_name, const char* modelViewMatrix_name); 196 + GPU_ShaderBlock (SDLCALL *LoadShaderBlock)(GPU_Renderer* renderer, Uint32 program_object, const char* position_name, const char* texcoord_name, const char* color_name, const char* modelViewMatrix_name); 197 197 198 198 /*! \see GPU_SetShaderBlock() */ 199 - void (*SetShaderBlock)(GPU_Renderer* renderer, GPU_ShaderBlock block); 199 + void (SDLCALL *SetShaderBlock)(GPU_Renderer* renderer, GPU_ShaderBlock block); 200 200 201 201 /*! \see GPU_SetShaderImage() */ 202 - void (*SetShaderImage)(GPU_Renderer* renderer, GPU_Image* image, int location, int image_unit); 202 + void (SDLCALL *SetShaderImage)(GPU_Renderer* renderer, GPU_Image* image, int location, int image_unit); 203 203 204 204 /*! \see GPU_GetUniformiv() */ 205 - void (*GetUniformiv)(GPU_Renderer* renderer, Uint32 program_object, int location, int* values); 205 + void (SDLCALL *GetUniformiv)(GPU_Renderer* renderer, Uint32 program_object, int location, int* values); 206 206 207 207 /*! \see GPU_SetUniformi() */ 208 - void (*SetUniformi)(GPU_Renderer* renderer, int location, int value); 208 + void (SDLCALL *SetUniformi)(GPU_Renderer* renderer, int location, int value); 209 209 210 210 /*! \see GPU_SetUniformiv() */ 211 - void (*SetUniformiv)(GPU_Renderer* renderer, int location, int num_elements_per_value, int num_values, int* values); 211 + void (SDLCALL *SetUniformiv)(GPU_Renderer* renderer, int location, int num_elements_per_value, int num_values, int* values); 212 212 213 213 /*! \see GPU_GetUniformuiv() */ 214 - void (*GetUniformuiv)(GPU_Renderer* renderer, Uint32 program_object, int location, unsigned int* values); 214 + void (SDLCALL *GetUniformuiv)(GPU_Renderer* renderer, Uint32 program_object, int location, unsigned int* values); 215 215 216 216 /*! \see GPU_SetUniformui() */ 217 - void (*SetUniformui)(GPU_Renderer* renderer, int location, unsigned int value); 217 + void (SDLCALL *SetUniformui)(GPU_Renderer* renderer, int location, unsigned int value); 218 218 219 219 /*! \see GPU_SetUniformuiv() */ 220 - void (*SetUniformuiv)(GPU_Renderer* renderer, int location, int num_elements_per_value, int num_values, unsigned int* values); 220 + void (SDLCALL *SetUniformuiv)(GPU_Renderer* renderer, int location, int num_elements_per_value, int num_values, unsigned int* values); 221 221 222 222 /*! \see GPU_GetUniformfv() */ 223 - void (*GetUniformfv)(GPU_Renderer* renderer, Uint32 program_object, int location, float* values); 223 + void (SDLCALL *GetUniformfv)(GPU_Renderer* renderer, Uint32 program_object, int location, float* values); 224 224 225 225 /*! \see GPU_SetUniformf() */ 226 - void (*SetUniformf)(GPU_Renderer* renderer, int location, float value); 226 + void (SDLCALL *SetUniformf)(GPU_Renderer* renderer, int location, float value); 227 227 228 228 /*! \see GPU_SetUniformfv() */ 229 - void (*SetUniformfv)(GPU_Renderer* renderer, int location, int num_elements_per_value, int num_values, float* values); 229 + void (SDLCALL *SetUniformfv)(GPU_Renderer* renderer, int location, int num_elements_per_value, int num_values, float* values); 230 230 231 231 /*! \see GPU_SetUniformMatrixfv() */ 232 - void (*SetUniformMatrixfv)(GPU_Renderer* renderer, int location, int num_matrices, int num_rows, int num_columns, Uint8 transpose, float* values); 232 + void (SDLCALL *SetUniformMatrixfv)(GPU_Renderer* renderer, int location, int num_matrices, int num_rows, int num_columns, Uint8 transpose, float* values); 233 233 234 234 /*! \see GPU_SetAttributef() */ 235 - void (*SetAttributef)(GPU_Renderer* renderer, int location, float value); 235 + void (SDLCALL *SetAttributef)(GPU_Renderer* renderer, int location, float value); 236 236 237 237 /*! \see GPU_SetAttributei() */ 238 - void (*SetAttributei)(GPU_Renderer* renderer, int location, int value); 238 + void (SDLCALL *SetAttributei)(GPU_Renderer* renderer, int location, int value); 239 239 240 240 /*! \see GPU_SetAttributeui() */ 241 - void (*SetAttributeui)(GPU_Renderer* renderer, int location, unsigned int value); 241 + void (SDLCALL *SetAttributeui)(GPU_Renderer* renderer, int location, unsigned int value); 242 242 243 243 /*! \see GPU_SetAttributefv() */ 244 - void (*SetAttributefv)(GPU_Renderer* renderer, int location, int num_elements, float* value); 244 + void (SDLCALL *SetAttributefv)(GPU_Renderer* renderer, int location, int num_elements, float* value); 245 245 246 246 /*! \see GPU_SetAttributeiv() */ 247 - void (*SetAttributeiv)(GPU_Renderer* renderer, int location, int num_elements, int* value); 247 + void (SDLCALL *SetAttributeiv)(GPU_Renderer* renderer, int location, int num_elements, int* value); 248 248 249 249 /*! \see GPU_SetAttributeuiv() */ 250 - void (*SetAttributeuiv)(GPU_Renderer* renderer, int location, int num_elements, unsigned int* value); 250 + void (SDLCALL *SetAttributeuiv)(GPU_Renderer* renderer, int location, int num_elements, unsigned int* value); 251 251 252 252 /*! \see GPU_SetAttributeSource() */ 253 - void (*SetAttributeSource)(GPU_Renderer* renderer, int num_values, GPU_Attribute source); 253 + void (SDLCALL *SetAttributeSource)(GPU_Renderer* renderer, int num_values, GPU_Attribute source); 254 254 255 255 256 256 // Shapes 257 257 258 258 /*! \see GPU_SetLineThickness() */ 259 - float (*SetLineThickness)(GPU_Renderer* renderer, float thickness); 259 + float (SDLCALL *SetLineThickness)(GPU_Renderer* renderer, float thickness); 260 260 261 261 /*! \see GPU_GetLineThickness() */ 262 - float (*GetLineThickness)(GPU_Renderer* renderer); 262 + float (SDLCALL *GetLineThickness)(GPU_Renderer* renderer); 263 263 264 264 /*! \see GPU_Pixel() */ 265 - void (*Pixel)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, SDL_Color color); 265 + void (SDLCALL *Pixel)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, SDL_Color color); 266 266 267 267 /*! \see GPU_Line() */ 268 - void (*Line)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); 268 + void (SDLCALL *Line)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); 269 269 270 270 /*! \see GPU_Arc() */ 271 - void (*Arc)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color); 271 + void (SDLCALL *Arc)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color); 272 272 273 273 /*! \see GPU_ArcFilled() */ 274 - void (*ArcFilled)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color); 274 + void (SDLCALL *ArcFilled)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color); 275 275 276 276 /*! \see GPU_Circle() */ 277 - void (*Circle)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float radius, SDL_Color color); 277 + void (SDLCALL *Circle)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float radius, SDL_Color color); 278 278 279 279 /*! \see GPU_CircleFilled() */ 280 - void (*CircleFilled)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float radius, SDL_Color color); 280 + void (SDLCALL *CircleFilled)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float radius, SDL_Color color); 281 281 282 282 /*! \see GPU_Ellipse() */ 283 - void (*Ellipse)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color); 283 + void (SDLCALL *Ellipse)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color); 284 284 285 285 /*! \see GPU_EllipseFilled() */ 286 - void (*EllipseFilled)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color); 286 + void (SDLCALL *EllipseFilled)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color); 287 287 288 288 /*! \see GPU_Sector() */ 289 - void (*Sector)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color); 289 + void (SDLCALL *Sector)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color); 290 290 291 291 /*! \see GPU_SectorFilled() */ 292 - void (*SectorFilled)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color); 292 + void (SDLCALL *SectorFilled)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color); 293 293 294 294 /*! \see GPU_Tri() */ 295 - void (*Tri)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color); 295 + void (SDLCALL *Tri)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color); 296 296 297 297 /*! \see GPU_TriFilled() */ 298 - void (*TriFilled)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color); 298 + void (SDLCALL *TriFilled)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color); 299 299 300 300 /*! \see GPU_Rectangle() */ 301 - void (*Rectangle)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); 301 + void (SDLCALL *Rectangle)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); 302 302 303 303 /*! \see GPU_RectangleFilled() */ 304 - void (*RectangleFilled)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); 304 + void (SDLCALL *RectangleFilled)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); 305 305 306 306 /*! \see GPU_RectangleRound() */ 307 - void (*RectangleRound)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color); 307 + void (SDLCALL *RectangleRound)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color); 308 308 309 309 /*! \see GPU_RectangleRoundFilled() */ 310 - void (*RectangleRoundFilled)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color); 310 + void (SDLCALL *RectangleRoundFilled)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color); 311 311 312 312 /*! \see GPU_Polygon() */ 313 - void (*Polygon)(GPU_Renderer* renderer, GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color); 313 + void (SDLCALL *Polygon)(GPU_Renderer* renderer, GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color); 314 314 315 315 /*! \see GPU_PolygonFilled() */ 316 - void (*PolygonFilled)(GPU_Renderer* renderer, GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color); 316 + void (SDLCALL *PolygonFilled)(GPU_Renderer* renderer, GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color); 317 317 318 318 } GPU_RendererImpl; 319 319