···11The MIT License (MIT)
22-Copyright (c) 2014 Jonathan Dearborn
22+Copyright (c) 2015 Jonathan Dearborn
3344Permission 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:
55
···55#include <stdio.h>
66#include <stdarg.h>
7788+// Use SDL's DLL defines
99+#include "begin_code.h"
810911#ifdef __cplusplus
1012extern "C" {
···574576575577// Visual C does not support static inline
576578#ifdef _MSC_VER
577577-static SDL_version GPU_GetCompiledVersion(void)
579579+static SDL_version SDLCALL GPU_GetCompiledVersion(void)
578580#else
579579-static inline SDL_version GPU_GetCompiledVersion(void)
581581+static inline SDL_version SDLCALL GPU_GetCompiledVersion(void)
580582#endif
581583{
582584 SDL_version v = {SDL_GPU_VERSION_MAJOR, SDL_GPU_VERSION_MINOR, SDL_GPU_VERSION_PATCH};
583585 return v;
584586}
585587586586-SDL_version GPU_GetLinkedVersion(void);
588588+DECLSPEC SDL_version SDLCALL GPU_GetLinkedVersion(void);
587589588590/*! The window corresponding to 'windowID' will be used to create the rendering context instead of creating a new window. */
589589-void GPU_SetInitWindow(Uint32 windowID);
591591+DECLSPEC void SDLCALL GPU_SetInitWindow(Uint32 windowID);
590592591593/*! Returns the window ID that has been set via GPU_SetInitWindow(). */
592592-Uint32 GPU_GetInitWindow(void);
594594+DECLSPEC Uint32 SDLCALL GPU_GetInitWindow(void);
593595594596/*! Set special flags to use for initialization. Set these before calling GPU_Init().
595597 * \param GPU_flags An OR'ed combination of GPU_InitFlagEnum flags. Default flags (0) enable late swap vsync and double buffering. */
596596-void GPU_SetPreInitFlags(GPU_InitFlagEnum GPU_flags);
598598+DECLSPEC void SDLCALL GPU_SetPreInitFlags(GPU_InitFlagEnum GPU_flags);
597599598600/*! Returns the current special flags to use for initialization. */
599599-GPU_InitFlagEnum GPU_GetPreInitFlags(void);
601601+DECLSPEC GPU_InitFlagEnum SDLCALL GPU_GetPreInitFlags(void);
600602601603/*! Set required features to use for initialization. Set these before calling GPU_Init().
602604 * \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. */
603603-void GPU_SetRequiredFeatures(GPU_FeatureEnum features);
605605+DECLSPEC void SDLCALL GPU_SetRequiredFeatures(GPU_FeatureEnum features);
604606605607/*! Returns the current required features to use for initialization. */
606606-GPU_FeatureEnum GPU_GetRequiredFeatures(void);
608608+DECLSPEC GPU_FeatureEnum SDLCALL GPU_GetRequiredFeatures(void);
607609608610/*! 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. */
609609-void GPU_GetDefaultRendererOrder(int* order_size, GPU_RendererID* order);
611611+DECLSPEC void SDLCALL GPU_GetDefaultRendererOrder(int* order_size, GPU_RendererID* order);
610612611613/*! 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. */
612612-void GPU_GetRendererOrder(int* order_size, GPU_RendererID* order);
614614+DECLSPEC void SDLCALL GPU_GetRendererOrder(int* order_size, GPU_RendererID* order);
613615614616/*! Sets the renderer ID order to use for initialization. If 'order' is NULL, it will restore the default order. */
615615-void GPU_SetRendererOrder(int order_size, GPU_RendererID* order);
617617+DECLSPEC void SDLCALL GPU_SetRendererOrder(int order_size, GPU_RendererID* order);
616618617619/*! Initializes SDL and SDL_gpu. Creates a window and goes through the renderer order to create a renderer context.
618620 * \see GPU_SetRendererOrder()
619621 */
620620-GPU_Target* GPU_Init(Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags);
622622+DECLSPEC GPU_Target* SDLCALL GPU_Init(Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags);
621623622624/*! Initializes SDL and SDL_gpu. Creates a window and the requested renderer context. */
623623-GPU_Target* GPU_InitRenderer(GPU_RendererEnum renderer_enum, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags);
625625+DECLSPEC GPU_Target* SDLCALL GPU_InitRenderer(GPU_RendererEnum renderer_enum, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags);
624626625627/*! Initializes SDL and SDL_gpu. Creates a window and the requested renderer context.
626628 * By requesting a renderer via ID, you can specify the major and minor versions of an individual renderer backend.
627629 * \see GPU_MakeRendererID
628630 */
629629-GPU_Target* GPU_InitRendererByID(GPU_RendererID renderer_request, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags);
631631+DECLSPEC GPU_Target* SDLCALL GPU_InitRendererByID(GPU_RendererID renderer_request, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags);
630632631633/*! 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.
632634 * \return 1 if all of the passed features are enabled/supported
633635 * \return 0 if any of the passed features are disabled/unsupported
634636 */
635635-Uint8 GPU_IsFeatureEnabled(GPU_FeatureEnum feature);
637637+DECLSPEC Uint8 SDLCALL GPU_IsFeatureEnabled(GPU_FeatureEnum feature);
636638637639/*! Clean up the renderer state. */
638638-void GPU_CloseCurrentRenderer(void);
640640+DECLSPEC void SDLCALL GPU_CloseCurrentRenderer(void);
639641640642/*! Clean up the renderer state and shut down SDL_gpu. */
641641-void GPU_Quit(void);
643643+DECLSPEC void SDLCALL GPU_Quit(void);
642644643645// End of Initialization
644646/*! @} */
···657659 * GPU_DEBUG_LEVEL_2: Elevates warning logs to error priority
658660 * GPU_DEBUG_LEVEL_3: Elevates info logs to error priority
659661 */
660660-void GPU_SetDebugLevel(GPU_DebugLevelEnum level);
662662+DECLSPEC void SDLCALL GPU_SetDebugLevel(GPU_DebugLevelEnum level);
661663662664/*! Returns the current global debug level. */
663663-GPU_DebugLevelEnum GPU_GetDebugLevel(void);
665665+DECLSPEC GPU_DebugLevelEnum SDLCALL GPU_GetDebugLevel(void);
664666665667/*! Prints an informational log message. */
666666-void GPU_LogInfo(const char* format, ...);
668668+DECLSPEC void SDLCALL GPU_LogInfo(const char* format, ...);
667669668670/*! Prints a warning log message. */
669669-void GPU_LogWarning(const char* format, ...);
671671+DECLSPEC void SDLCALL GPU_LogWarning(const char* format, ...);
670672671673/*! Prints an error log message. */
672672-void GPU_LogError(const char* format, ...);
674674+DECLSPEC void SDLCALL GPU_LogError(const char* format, ...);
673675674676/*! Pushes a new error code onto the error stack. If the stack is full, this function does nothing.
675677 * \param function The name of the function that pushed the error
676678 * \param error The error code to push on the error stack
677679 * \param details Additional information string, can be NULL.
678680 */
679679-void GPU_PushErrorCode(const char* function, GPU_ErrorEnum error, const char* details, ...);
681681+DECLSPEC void SDLCALL GPU_PushErrorCode(const char* function, GPU_ErrorEnum error, const char* details, ...);
680682681683/*! 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. */
682682-GPU_ErrorObject GPU_PopErrorCode(void);
684684+DECLSPEC GPU_ErrorObject SDLCALL GPU_PopErrorCode(void);
683685684686/*! Gets the string representation of an error code. */
685685-const char* GPU_GetErrorString(GPU_ErrorEnum error);
687687+DECLSPEC const char* SDLCALL GPU_GetErrorString(GPU_ErrorEnum error);
686688687689// End of Logging
688690/*! @} */
···697699 * @{ */
698700699701/*! Returns an initialized GPU_RendererID. */
700700-GPU_RendererID GPU_MakeRendererID(const char* name, GPU_RendererEnum renderer, int major_version, int minor_version);
702702+DECLSPEC GPU_RendererID SDLCALL GPU_MakeRendererID(const char* name, GPU_RendererEnum renderer, int major_version, int minor_version);
701703702704/*! Gets the first registered renderer identifier for the given enum value. */
703703-GPU_RendererID GPU_GetRendererID(GPU_RendererEnum renderer);
705705+DECLSPEC GPU_RendererID SDLCALL GPU_GetRendererID(GPU_RendererEnum renderer);
704706705707/*! Gets the renderer identifier for the given registration index. */
706706-GPU_RendererID GPU_GetRendererIDByIndex(unsigned int index);
708708+DECLSPEC GPU_RendererID SDLCALL GPU_GetRendererIDByIndex(unsigned int index);
707709708710/*! Gets the number of registered (available) renderers. */
709709-int GPU_GetNumRegisteredRenderers(void);
711711+DECLSPEC int SDLCALL GPU_GetNumRegisteredRenderers(void);
710712711713/*! Gets an array of identifiers for the registered (available) renderers. */
712712-void GPU_GetRegisteredRendererList(GPU_RendererID* renderers_array);
714714+DECLSPEC void SDLCALL GPU_GetRegisteredRendererList(GPU_RendererID* renderers_array);
713715714716/*! Prepares a renderer for use by SDL_gpu. */
715715-void GPU_RegisterRenderer(GPU_RendererID id, GPU_Renderer* (*create_renderer)(GPU_RendererID request), void (*free_renderer)(GPU_Renderer* renderer));
717717+DECLSPEC void SDLCALL GPU_RegisterRenderer(GPU_RendererID id, GPU_Renderer* (*create_renderer)(GPU_RendererID request), void(*free_renderer)(GPU_Renderer* renderer));
716718717719// End of RendererSetup
718720/*! @} */
···723725 * @{ */
724726725727/*! Gets the next enum ID that can be used for a custom renderer. */
726726-GPU_RendererEnum GPU_ReserveNextRendererEnum(void);
728728+DECLSPEC GPU_RendererEnum SDLCALL GPU_ReserveNextRendererEnum(void);
727729728730/*! Gets the number of active (created) renderers. */
729729-int GPU_GetNumActiveRenderers(void);
731731+DECLSPEC int SDLCALL GPU_GetNumActiveRenderers(void);
730732731733/*! Gets an array of identifiers for the active renderers. */
732732-void GPU_GetActiveRendererList(GPU_RendererID* renderers_array);
734734+DECLSPEC void SDLCALL GPU_GetActiveRendererList(GPU_RendererID* renderers_array);
733735734736/*! Gets the renderer for the given renderer index. */
735735-GPU_Renderer* GPU_GetRenderer(unsigned int index);
737737+DECLSPEC GPU_Renderer* SDLCALL GPU_GetRenderer(unsigned int index);
736738737739/*! \return The renderer matching the given identifier. */
738738-GPU_Renderer* GPU_GetRendererByID(GPU_RendererID id);
740740+DECLSPEC GPU_Renderer* SDLCALL GPU_GetRendererByID(GPU_RendererID id);
739741740742/*! \return The current renderer */
741741-GPU_Renderer* GPU_GetCurrentRenderer(void);
743743+DECLSPEC GPU_Renderer* SDLCALL GPU_GetCurrentRenderer(void);
742744743745/*! Switches the current renderer to the renderer matching the given identifier. */
744744-void GPU_SetCurrentRenderer(GPU_RendererID id);
746746+DECLSPEC void SDLCALL GPU_SetCurrentRenderer(GPU_RendererID id);
745747746748/*! 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. */
747747-void GPU_ResetRendererState(void);
749749+DECLSPEC void SDLCALL GPU_ResetRendererState(void);
748750749751// End of RendererControls
750752/*! @} */
···758760 * @{ */
759761760762/*! \return The renderer's current context target. */
761761-GPU_Target* GPU_GetContextTarget(void);
763763+DECLSPEC GPU_Target* SDLCALL GPU_GetContextTarget(void);
762764763765/*! \return The target that is associated with the given windowID. */
764764-GPU_Target* GPU_GetWindowTarget(Uint32 windowID);
766766+DECLSPEC GPU_Target* SDLCALL GPU_GetWindowTarget(Uint32 windowID);
765767766768/*! Creates a separate context for the given window using the current renderer and returns a GPU_Target that represents it. */
767767-GPU_Target* GPU_CreateTargetFromWindow(Uint32 windowID);
769769+DECLSPEC GPU_Target* SDLCALL GPU_CreateTargetFromWindow(Uint32 windowID);
768770769771/*! Makes the given window the current rendering destination for the given context target.
770772 * This also makes the target the current context for image loading and window operations.
771773 * If the target does not represent a window, this does nothing.
772774 */
773773-void GPU_MakeCurrent(GPU_Target* target, Uint32 windowID);
775775+DECLSPEC void SDLCALL GPU_MakeCurrent(GPU_Target* target, Uint32 windowID);
774776775777/*! Change the actual size of the current context target's window. This resets the virtual resolution and viewport of the context target.
776778 * Aside from direct resolution changes, this should also be called in response to SDL_WINDOWEVENT_RESIZED window events for resizable windows. */
777777-Uint8 GPU_SetWindowResolution(Uint16 w, Uint16 h);
779779+DECLSPEC Uint8 SDLCALL GPU_SetWindowResolution(Uint16 w, Uint16 h);
778780779781/*! Enable/disable fullscreen mode for the current context target's window.
780782 * 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.
781783 * \param enable_fullscreen If true, make the application go fullscreen. If false, make the application go to windowed mode.
782784 * \param use_desktop_resolution If true, lets the window change its resolution when it enters fullscreen mode (via SDL_WINDOW_FULLSCREEN_DESKTOP).
783785 * \return 0 if the new mode is windowed, 1 if the new mode is fullscreen. */
784784-Uint8 GPU_SetFullscreen(Uint8 enable_fullscreen, Uint8 use_desktop_resolution);
786786+DECLSPEC Uint8 SDLCALL GPU_SetFullscreen(Uint8 enable_fullscreen, Uint8 use_desktop_resolution);
785787786788/*! Returns true if the current context target's window is in fullscreen mode. */
787787-Uint8 GPU_GetFullscreen(void);
789789+DECLSPEC Uint8 SDLCALL GPU_GetFullscreen(void);
788790789791/*! Enables/disables alpha blending for shape rendering on the current window. */
790790-void GPU_SetShapeBlending(Uint8 enable);
792792+DECLSPEC void SDLCALL GPU_SetShapeBlending(Uint8 enable);
791793792794/*! Translates a blend preset into a blend mode. */
793793-GPU_BlendMode GPU_GetBlendModeFromPreset(GPU_BlendPresetEnum preset);
795795+DECLSPEC GPU_BlendMode SDLCALL GPU_GetBlendModeFromPreset(GPU_BlendPresetEnum preset);
794796795797/*! Sets the blending component functions for shape rendering. */
796796-void GPU_SetShapeBlendFunction(GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha);
798798+DECLSPEC void SDLCALL GPU_SetShapeBlendFunction(GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha);
797799798800/*! Sets the blending component equations for shape rendering. */
799799-void GPU_SetShapeBlendEquation(GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation);
801801+DECLSPEC void SDLCALL GPU_SetShapeBlendEquation(GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation);
800802801803/*! Sets the blending mode for shape rendering on the current window, if supported by the renderer. */
802802-void GPU_SetShapeBlendMode(GPU_BlendPresetEnum mode);
804804+DECLSPEC void SDLCALL GPU_SetShapeBlendMode(GPU_BlendPresetEnum mode);
803805804806/*! Sets the thickness of lines for the current context.
805807 * \param thickness New line thickness in pixels measured across the line. Default is 1.0f.
806808 * \return The old thickness value
807809 */
808808-float GPU_SetLineThickness(float thickness);
810810+DECLSPEC float SDLCALL GPU_SetLineThickness(float thickness);
809811810812/*! Returns the current line thickness value. */
811811-float GPU_GetLineThickness(void);
813813+DECLSPEC float SDLCALL GPU_GetLineThickness(void);
812814813815// End of ContextControls
814816/*! @} */
···821823822824/*! Creates a target that aliases the given target. Aliases can be used to store target settings (e.g. viewports) for easy switching.
823825 * GPU_FreeTarget() frees the alias's memory, but does not affect the original. */
824824-GPU_Target* GPU_CreateAliasTarget(GPU_Target* target);
826826+DECLSPEC GPU_Target* SDLCALL GPU_CreateAliasTarget(GPU_Target* target);
825827826828/*! Creates a new render target from the given image. It can then be accessed from image->target. */
827827-GPU_Target* GPU_LoadTarget(GPU_Image* image);
829829+DECLSPEC GPU_Target* SDLCALL GPU_LoadTarget(GPU_Image* image);
828830829831/*! Deletes a render target in the proper way for this renderer. */
830830-void GPU_FreeTarget(GPU_Target* target);
832832+DECLSPEC void SDLCALL GPU_FreeTarget(GPU_Target* target);
831833832834/*! Change the logical size of the given target. Rendering to this target will be scaled as if the dimensions were actually the ones given. */
833833-void GPU_SetVirtualResolution(GPU_Target* target, Uint16 w, Uint16 h);
835835+DECLSPEC void SDLCALL GPU_SetVirtualResolution(GPU_Target* target, Uint16 w, Uint16 h);
834836835837/*! Converts screen space coordinates (such as from mouse input) to logical drawing coordinates. */
836836-void GPU_GetVirtualCoords(GPU_Target* target, float* x, float* y, float displayX, float displayY);
838838+DECLSPEC void SDLCALL GPU_GetVirtualCoords(GPU_Target* target, float* x, float* y, float displayX, float displayY);
837839838840/*! Reset the logical size of the given target to its original value. */
839839-void GPU_UnsetVirtualResolution(GPU_Target* target);
841841+DECLSPEC void SDLCALL GPU_UnsetVirtualResolution(GPU_Target* target);
840842841843/*! \return A GPU_Rect with the given values. */
842842-GPU_Rect GPU_MakeRect(float x, float y, float w, float h);
844844+DECLSPEC GPU_Rect SDLCALL GPU_MakeRect(float x, float y, float w, float h);
843845844846/*! \return An SDL_Color with the given values. */
845845-SDL_Color GPU_MakeColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a);
847847+DECLSPEC SDL_Color SDLCALL GPU_MakeColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a);
846848847849/*! Sets the given target's viewport. */
848848-void GPU_SetViewport(GPU_Target* target, GPU_Rect viewport);
850850+DECLSPEC void SDLCALL GPU_SetViewport(GPU_Target* target, GPU_Rect viewport);
849851850852/*! \return A GPU_Camera with position (0, 0, -10), angle of 0, and zoom of 1. */
851851-GPU_Camera GPU_GetDefaultCamera(void);
853853+DECLSPEC GPU_Camera SDLCALL GPU_GetDefaultCamera(void);
852854853855/*! \return The camera of the given render target. If target is NULL, returns the default camera. */
854854-GPU_Camera GPU_GetCamera(GPU_Target* target);
856856+DECLSPEC GPU_Camera SDLCALL GPU_GetCamera(GPU_Target* target);
855857856858/*! Sets the current render target's current camera.
857859 * \param target A pointer to the target that will copy this camera.
858860 * \param cam A pointer to the camera data to use or NULL to use the default camera.
859861 * \return The old camera. */
860860-GPU_Camera GPU_SetCamera(GPU_Target* target, GPU_Camera* cam);
862862+DECLSPEC GPU_Camera SDLCALL GPU_SetCamera(GPU_Target* target, GPU_Camera* cam);
861863862864/*! \return The RGBA color of a pixel. */
863863-SDL_Color GPU_GetPixel(GPU_Target* target, Sint16 x, Sint16 y);
865865+DECLSPEC SDL_Color SDLCALL GPU_GetPixel(GPU_Target* target, Sint16 x, Sint16 y);
864866865867/*! Sets the clipping rect for the given render target. */
866866-GPU_Rect GPU_SetClipRect(GPU_Target* target, GPU_Rect rect);
868868+DECLSPEC GPU_Rect SDLCALL GPU_SetClipRect(GPU_Target* target, GPU_Rect rect);
867869868870/*! Sets the clipping rect for the given render target. */
869869-GPU_Rect GPU_SetClip(GPU_Target* target, Sint16 x, Sint16 y, Uint16 w, Uint16 h);
871871+DECLSPEC GPU_Rect SDLCALL GPU_SetClip(GPU_Target* target, Sint16 x, Sint16 y, Uint16 w, Uint16 h);
870872871873/*! Turns off clipping for the given target. */
872872-void GPU_UnsetClip(GPU_Target* target);
874874+DECLSPEC void SDLCALL GPU_UnsetClip(GPU_Target* target);
873875874876/*! Sets the modulation color for subsequent drawing of images and shapes on the given target.
875877 * This has a cumulative effect with the image coloring functions.
876878 * e.g. GPU_SetRGB(image, 255, 128, 0); GPU_SetTargetRGB(target, 128, 128, 128);
877879 * Would make the image draw with color of roughly (128, 64, 0).
878880 */
879879-void GPU_SetTargetColor(GPU_Target* target, SDL_Color color);
881881+DECLSPEC void SDLCALL GPU_SetTargetColor(GPU_Target* target, SDL_Color color);
880882881883/*! Sets the modulation color for subsequent drawing of images and shapes on the given target.
882884 * This has a cumulative effect with the image coloring functions.
883885 * e.g. GPU_SetRGB(image, 255, 128, 0); GPU_SetTargetRGB(target, 128, 128, 128);
884886 * Would make the image draw with color of roughly (128, 64, 0).
885887 */
886886-void GPU_SetTargetRGB(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b);
888888+DECLSPEC void SDLCALL GPU_SetTargetRGB(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b);
887889888890/*! Sets the modulation color for subsequent drawing of images and shapes on the given target.
889891 * This has a cumulative effect with the image coloring functions.
890892 * e.g. GPU_SetRGB(image, 255, 128, 0); GPU_SetTargetRGB(target, 128, 128, 128);
891893 * Would make the image draw with color of roughly (128, 64, 0).
892894 */
893893-void GPU_SetTargetRGBA(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
895895+DECLSPEC void SDLCALL GPU_SetTargetRGBA(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
894896895897/*! Unsets the modulation color for subsequent drawing of images and shapes on the given target.
896898 * This has the same effect as coloring with pure opaque white (255, 255, 255, 255).
897899 */
898898-void GPU_UnsetTargetColor(GPU_Target* target);
900900+DECLSPEC void SDLCALL GPU_UnsetTargetColor(GPU_Target* target);
899901900902// End of TargetControls
901903/*! @} */
···906908 * @{ */
907909908910/*! Load surface from an image file that is supported by this renderer. Don't forget to SDL_FreeSurface() it. */
909909-SDL_Surface* GPU_LoadSurface(const char* filename);
911911+DECLSPEC SDL_Surface* SDLCALL GPU_LoadSurface(const char* filename);
910912911913/*! Save surface to a file. The file type is deduced from the extension. Supported formats are: png, bmp, tga. Returns 0 on failure. */
912912-Uint8 GPU_SaveSurface(SDL_Surface* surface, const char* filename);
914914+DECLSPEC Uint8 SDLCALL GPU_SaveSurface(SDL_Surface* surface, const char* filename);
913915914916// End of SurfaceControls
915917/*! @} */
···925927 * \param h Image height in pixels
926928 * \param format Format of color channels.
927929 */
928928-GPU_Image* GPU_CreateImage(Uint16 w, Uint16 h, GPU_FormatEnum format);
930930+DECLSPEC GPU_Image* SDLCALL GPU_CreateImage(Uint16 w, Uint16 h, GPU_FormatEnum format);
929931930932/*! Create a new image that uses the given native texture handle as the image texture. */
931931-GPU_Image* GPU_CreateImageUsingTexture(Uint32 handle, Uint8 take_ownership);
933933+DECLSPEC GPU_Image* SDLCALL GPU_CreateImageUsingTexture(Uint32 handle, Uint8 take_ownership);
932934933935/*! Load image from an image file that is supported by this renderer. Don't forget to GPU_FreeImage() it. */
934934-GPU_Image* GPU_LoadImage(const char* filename);
936936+DECLSPEC GPU_Image* SDLCALL GPU_LoadImage(const char* filename);
935937936938/*! Creates an image that aliases the given image. Aliases can be used to store image settings (e.g. modulation color) for easy switching.
937939 * GPU_FreeImage() frees the alias's memory, but does not affect the original. */
938938-GPU_Image* GPU_CreateAliasImage(GPU_Image* image);
940940+DECLSPEC GPU_Image* SDLCALL GPU_CreateAliasImage(GPU_Image* image);
939941940942/*! Copy an image to a new image. Don't forget to GPU_FreeImage() both. */
941941-GPU_Image* GPU_CopyImage(GPU_Image* image);
943943+DECLSPEC GPU_Image* SDLCALL GPU_CopyImage(GPU_Image* image);
942944943945/*! 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! */
944944-void GPU_FreeImage(GPU_Image* image);
946946+DECLSPEC void SDLCALL GPU_FreeImage(GPU_Image* image);
945947946948/*! Update an image from surface data. */
947947-void GPU_UpdateImage(GPU_Image* image, SDL_Surface* surface, const GPU_Rect* surface_rect);
949949+DECLSPEC void SDLCALL GPU_UpdateImage(GPU_Image* image, SDL_Surface* surface, const GPU_Rect* surface_rect);
948950949951/*! Update an image from surface data. */
950950-void GPU_UpdateSubImage(GPU_Image* image, const GPU_Rect* image_rect, SDL_Surface* surface, const GPU_Rect* surface_rect);
952952+DECLSPEC void SDLCALL GPU_UpdateSubImage(GPU_Image* image, const GPU_Rect* image_rect, SDL_Surface* surface, const GPU_Rect* surface_rect);
951953952954/*! Update an image from an array of pixel data. */
953953-void GPU_UpdateImageBytes(GPU_Image* image, const GPU_Rect* image_rect, const unsigned char* bytes, int bytes_per_row);
955955+DECLSPEC void SDLCALL GPU_UpdateImageBytes(GPU_Image* image, const GPU_Rect* image_rect, const unsigned char* bytes, int bytes_per_row);
954956955957/*! Save image to a file. The file type is deduced from the extension. Supported formats are: png, bmp, tga. Returns 0 on failure. */
956956-Uint8 GPU_SaveImage(GPU_Image* image, const char* filename);
958958+DECLSPEC Uint8 SDLCALL GPU_SaveImage(GPU_Image* image, const char* filename);
957959958960/*! Loads mipmaps for the given image, if supported by the renderer. */
959959-void GPU_GenerateMipmaps(GPU_Image* image);
961961+DECLSPEC void SDLCALL GPU_GenerateMipmaps(GPU_Image* image);
960962961963/*! Sets the modulation color for subsequent drawing of the given image. */
962962-void GPU_SetColor(GPU_Image* image, SDL_Color color);
964964+DECLSPEC void SDLCALL GPU_SetColor(GPU_Image* image, SDL_Color color);
963965964966/*! Sets the modulation color for subsequent drawing of the given image. */
965965-void GPU_SetRGB(GPU_Image* image, Uint8 r, Uint8 g, Uint8 b);
967967+DECLSPEC void SDLCALL GPU_SetRGB(GPU_Image* image, Uint8 r, Uint8 g, Uint8 b);
966968967969/*! Sets the modulation color for subsequent drawing of the given image. */
968968-void GPU_SetRGBA(GPU_Image* image, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
970970+DECLSPEC void SDLCALL GPU_SetRGBA(GPU_Image* image, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
969971970972/*! Unsets the modulation color for subsequent drawing of the given image.
971973 * This is equivalent to coloring with pure opaque white (255, 255, 255, 255). */
972972-void GPU_UnsetColor(GPU_Image* image);
974974+DECLSPEC void SDLCALL GPU_UnsetColor(GPU_Image* image);
973975974976/*! Gets the current alpha blending setting. */
975975-Uint8 GPU_GetBlending(GPU_Image* image);
977977+DECLSPEC Uint8 SDLCALL GPU_GetBlending(GPU_Image* image);
976978977979/*! Enables/disables alpha blending for the given image. */
978978-void GPU_SetBlending(GPU_Image* image, Uint8 enable);
980980+DECLSPEC void SDLCALL GPU_SetBlending(GPU_Image* image, Uint8 enable);
979981980982/*! Sets the blending component functions. */
981981-void GPU_SetBlendFunction(GPU_Image* image, GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha);
983983+DECLSPEC void SDLCALL GPU_SetBlendFunction(GPU_Image* image, GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha);
982984983985/*! Sets the blending component equations. */
984984-void GPU_SetBlendEquation(GPU_Image* image, GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation);
986986+DECLSPEC void SDLCALL GPU_SetBlendEquation(GPU_Image* image, GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation);
985987986988/*! Sets the blending mode, if supported by the renderer. */
987987-void GPU_SetBlendMode(GPU_Image* image, GPU_BlendPresetEnum mode);
989989+DECLSPEC void SDLCALL GPU_SetBlendMode(GPU_Image* image, GPU_BlendPresetEnum mode);
988990989991/*! Sets the image filtering mode, if supported by the renderer. */
990990-void GPU_SetImageFilter(GPU_Image* image, GPU_FilterEnum filter);
992992+DECLSPEC void SDLCALL GPU_SetImageFilter(GPU_Image* image, GPU_FilterEnum filter);
991993992994/*! Gets the current pixel snap setting. The default value is GPU_SNAP_POSITION_AND_DIMENSIONS. */
993993-GPU_SnapEnum GPU_GetSnapMode(GPU_Image* image);
995995+DECLSPEC GPU_SnapEnum SDLCALL GPU_GetSnapMode(GPU_Image* image);
994996995997/*! Sets the pixel grid snapping mode for the given image. */
996996-void GPU_SetSnapMode(GPU_Image* image, GPU_SnapEnum mode);
998998+DECLSPEC void SDLCALL GPU_SetSnapMode(GPU_Image* image, GPU_SnapEnum mode);
9979999981000/*! Sets the image wrapping mode, if supported by the renderer. */
999999-void GPU_SetWrapMode(GPU_Image* image, GPU_WrapEnum wrap_mode_x, GPU_WrapEnum wrap_mode_y);
10011001+DECLSPEC void SDLCALL GPU_SetWrapMode(GPU_Image* image, GPU_WrapEnum wrap_mode_x, GPU_WrapEnum wrap_mode_y);
1000100210011003// End of ImageControls
10021004/*! @} */
···10071009 * @{ */
1008101010091011/*! Copy SDL_Surface data into a new GPU_Image. Don't forget to SDL_FreeSurface() the surface and GPU_FreeImage() the image.*/
10101010-GPU_Image* GPU_CopyImageFromSurface(SDL_Surface* surface);
10121012+DECLSPEC GPU_Image* SDLCALL GPU_CopyImageFromSurface(SDL_Surface* surface);
1011101310121014/*! Copy GPU_Target data into a new GPU_Image. Don't forget to GPU_FreeImage() the image.*/
10131013-GPU_Image* GPU_CopyImageFromTarget(GPU_Target* target);
10151015+DECLSPEC GPU_Image* SDLCALL GPU_CopyImageFromTarget(GPU_Target* target);
1014101610151017/*! Copy GPU_Target data into a new SDL_Surface. Don't forget to SDL_FreeSurface() the surface.*/
10161016-SDL_Surface* GPU_CopySurfaceFromTarget(GPU_Target* target);
10181018+DECLSPEC SDL_Surface* SDLCALL GPU_CopySurfaceFromTarget(GPU_Target* target);
1017101910181020/*! Copy GPU_Image data into a new SDL_Surface. Don't forget to SDL_FreeSurface() the surface and GPU_FreeImage() the image.*/
10191019-SDL_Surface* GPU_CopySurfaceFromImage(GPU_Image* image);
10211021+DECLSPEC SDL_Surface* SDLCALL GPU_CopySurfaceFromImage(GPU_Image* image);
1020102210211023// End of Conversions
10221024/*! @} */
···10321034// Basic matrix operations (4x4)
1033103510341036/*! Copy matrix A to the given 'result' matrix. */
10351035-void GPU_MatrixCopy(float* result, const float* A);
10371037+DECLSPEC void SDLCALL GPU_MatrixCopy(float* result, const float* A);
1036103810371039/*! Fills 'result' matrix with the identity matrix. */
10381038-void GPU_MatrixIdentity(float* result);
10401040+DECLSPEC void SDLCALL GPU_MatrixIdentity(float* result);
1039104110401042/*! 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'.
10411043 * \see GPU_MultiplyAndAssign
10421044*/
10431043-void GPU_Multiply4x4(float* result, float* A, float* B);
10451045+DECLSPEC void SDLCALL GPU_Multiply4x4(float* result, float* A, float* B);
1044104610451047/*! Multiplies matrices 'result' and A and stores the result in the given 'result' matrix (result = result * A). */
10461046-void GPU_MultiplyAndAssign(float* result, float* A);
10481048+DECLSPEC void SDLCALL GPU_MultiplyAndAssign(float* result, float* A);
104710491048105010491051// Matrix stack accessors
1050105210511053/*! Returns an internal string that represents the contents of matrix A. */
10521052-const char* GPU_GetMatrixString(float* A);
10541054+DECLSPEC const char* SDLCALL GPU_GetMatrixString(float* A);
1053105510541056/*! Returns the current matrix from the top of the matrix stack. Returns NULL if stack is empty. */
10551055-float* GPU_GetCurrentMatrix(void);
10571057+DECLSPEC float* SDLCALL GPU_GetCurrentMatrix(void);
1056105810571059/*! Returns the current modelview matrix from the top of the matrix stack. Returns NULL if stack is empty. */
10581058-float* GPU_GetModelView(void);
10601060+DECLSPEC float* SDLCALL GPU_GetModelView(void);
1059106110601062/*! Returns the current projection matrix from the top of the matrix stack. Returns NULL if stack is empty. */
10611061-float* GPU_GetProjection(void);
10631063+DECLSPEC float* SDLCALL GPU_GetProjection(void);
1062106410631065/*! Copies the current modelview-projection matrix into the given 'result' matrix (result = P*M). */
10641064-void GPU_GetModelViewProjection(float* result);
10661066+DECLSPEC void SDLCALL GPU_GetModelViewProjection(float* result);
106510671066106810671069// Matrix stack manipulators
1068107010691071/*! Changes matrix mode to either GPU_PROJECTION or GPU_MODELVIEW. Further matrix stack operations manipulate that particular stack. */
10701070-void GPU_MatrixMode(int matrix_mode);
10721072+DECLSPEC void SDLCALL GPU_MatrixMode(int matrix_mode);
1071107310721074/*! Pushes the current matrix as a new matrix stack item. */
10731073-void GPU_PushMatrix(void);
10751075+DECLSPEC void SDLCALL GPU_PushMatrix(void);
1074107610751077/*! Removes the current matrix from the stack. */
10761076-void GPU_PopMatrix(void);
10781078+DECLSPEC void SDLCALL GPU_PopMatrix(void);
1077107910781080/*! Fills current matrix with the identity matrix. */
10791079-void GPU_LoadIdentity(void);
10811081+DECLSPEC void SDLCALL GPU_LoadIdentity(void);
1080108210811083/*! Multiplies an orthographic projection matrix into the current matrix. */
10821082-void GPU_Ortho(float left, float right, float bottom, float top, float near, float far);
10841084+DECLSPEC void SDLCALL GPU_Ortho(float left, float right, float bottom, float top, float near, float far);
1083108510841086/*! Multiplies a perspective projection matrix into the current matrix. */
10851085-void GPU_Frustum(float right, float left, float bottom, float top, float near, float far);
10871087+DECLSPEC void SDLCALL GPU_Frustum(float right, float left, float bottom, float top, float near, float far);
1086108810871089/*! Adds a translation into the current matrix. */
10881088-void GPU_Translate(float x, float y, float z);
10901090+DECLSPEC void SDLCALL GPU_Translate(float x, float y, float z);
1089109110901092/*! Multiplies a scaling matrix into the current matrix. */
10911091-void GPU_Scale(float sx, float sy, float sz);
10931093+DECLSPEC void SDLCALL GPU_Scale(float sx, float sy, float sz);
1092109410931095/*! Multiplies a rotation matrix into the current matrix. */
10941094-void GPU_Rotate(float degrees, float x, float y, float z);
10961096+DECLSPEC void SDLCALL GPU_Rotate(float degrees, float x, float y, float z);
1095109710961098/*! Multiplies a given matrix into the current matrix. */
10971097-void GPU_MultMatrix(float* matrix4x4);
10991099+DECLSPEC void SDLCALL GPU_MultMatrix(float* matrix4x4);
1098110010991101// End of Matrix
11001102/*! @} */
···11081110 * @{ */
1109111111101112/*! Clears the contents of the given render target. Fills the target with color {0, 0, 0, 0}. */
11111111-void GPU_Clear(GPU_Target* target);
11131113+DECLSPEC void SDLCALL GPU_Clear(GPU_Target* target);
1112111411131115/*! Fills the given render target with a color. */
11141114-void GPU_ClearColor(GPU_Target* target, SDL_Color color);
11161116+DECLSPEC void SDLCALL GPU_ClearColor(GPU_Target* target, SDL_Color color);
1115111711161118/*! Fills the given render target with a color (alpha is 255, fully opaque). */
11171117-void GPU_ClearRGB(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b);
11191119+DECLSPEC void SDLCALL GPU_ClearRGB(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b);
1118112011191121/*! Fills the given render target with a color. */
11201120-void GPU_ClearRGBA(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
11221122+DECLSPEC void SDLCALL GPU_ClearRGBA(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
1121112311221124/*! Draws the given image to the given render target.
11231125 * \param src_rect The region of the source image to use.
11241126 * \param x Destination x-position
11251127 * \param y Destination y-position */
11261126-void GPU_Blit(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y);
11281128+DECLSPEC void SDLCALL GPU_Blit(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y);
1127112911281130/*! Rotates and draws the given image to the given render target.
11291131 * \param src_rect The region of the source image to use.
11301132 * \param x Destination x-position
11311133 * \param y Destination y-position
11321134 * \param degrees Rotation angle (in degrees) */
11331133-void GPU_BlitRotate(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float degrees);
11351135+DECLSPEC void SDLCALL GPU_BlitRotate(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float degrees);
1134113611351137/*! Scales and draws the given image to the given render target.
11361138 * \param src_rect The region of the source image to use.
···11381140 * \param y Destination y-position
11391141 * \param scaleX Horizontal stretch factor
11401142 * \param scaleY Vertical stretch factor */
11411141-void GPU_BlitScale(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float scaleX, float scaleY);
11431143+DECLSPEC void SDLCALL GPU_BlitScale(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float scaleX, float scaleY);
1142114411431145/*! Scales, rotates, and draws the given image to the given render target.
11441146 * \param src_rect The region of the source image to use.
···11471149 * \param degrees Rotation angle (in degrees)
11481150 * \param scaleX Horizontal stretch factor
11491151 * \param scaleY Vertical stretch factor */
11501150-void GPU_BlitTransform(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float degrees, float scaleX, float scaleY);
11521152+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);
1151115311521154/*! 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).
11531155 * \param src_rect The region of the source image to use.
···11581160 * \param degrees Rotation angle (in degrees)
11591161 * \param scaleX Horizontal stretch factor
11601162 * \param scaleY Vertical stretch factor */
11611161-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);
11631163+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);
1162116411631165/*! Transforms and draws the given image to the given render target.
11641166 * \param src_rect The region of the source image to use.
11651167 * \param x Destination x-position
11661168 * \param y Destination y-position
11671169 * \param matrix3x3 3x3 matrix in column-major order (index = row + column*numColumns) */
11681168-void GPU_BlitTransformMatrix(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float* matrix3x3);
11701170+DECLSPEC void SDLCALL GPU_BlitTransformMatrix(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float* matrix3x3);
1169117111701172/*! Performs 'num_sprites' blits of the given image to the given target.
11711173 * Note: GPU_BlitBatch() cannot interpret a mix of normal values and "passthrough" values due to format ambiguity.
11721174 * \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.
11731175 * \param flags Bit flags to control the interpretation of the array parameters. The only passthrough option accepted is GPU_PASSTHROUGH_ALL.
11741176 */
11751175-void GPU_BlitBatch(GPU_Image* image, GPU_Target* target, unsigned int num_sprites, float* values, GPU_BlitFlagEnum flags);
11771177+DECLSPEC void SDLCALL GPU_BlitBatch(GPU_Image* image, GPU_Target* target, unsigned int num_sprites, float* values, GPU_BlitFlagEnum flags);
1176117811771179/*! Performs 'num_sprites' blits of the given image to the given target.
11781180 * \param positions A tightly-packed array of (x,y) values
···11801182 * \param colors A tightly-packed array of (r,g,b,a) values with a range from 0-255
11811183 * \param flags Bit flags to control the interpretation of the array parameters
11821184 */
11831183-void GPU_BlitBatchSeparate(GPU_Image* image, GPU_Target* target, unsigned int num_sprites, float* positions, float* src_rects, float* colors, GPU_BlitFlagEnum flags);
11851185+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);
1184118611851187/*! Renders triangles from the given set of vertices. This lets you render arbitrary 2D geometry.
11861188 * \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.
11871189 * \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).
11881190 * \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].
11891191 */
11901190-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);
11921192+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);
1191119311921194/*! Send all buffered blitting data to the current context target. */
11931193-void GPU_FlushBlitBuffer(void);
11951195+DECLSPEC void SDLCALL GPU_FlushBlitBuffer(void);
1194119611951197/*! Updates the given target's associated window. */
11961196-void GPU_Flip(GPU_Target* target);
11981198+DECLSPEC void SDLCALL GPU_Flip(GPU_Target* target);
1197119911981200// End of Rendering
11991201/*! @} */
···12111213 * \param y y-coord of the point
12121214 * \param color The color of the shape to render
12131215 */
12141214-void GPU_Pixel(GPU_Target* target, float x, float y, SDL_Color color);
12161216+DECLSPEC void SDLCALL GPU_Pixel(GPU_Target* target, float x, float y, SDL_Color color);
1215121712161218/*! Renders a colored line.
12171219 * \param target The destination render target
···12211223 * \param y2 y-coord of ending point
12221224 * \param color The color of the shape to render
12231225 */
12241224-void GPU_Line(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color);
12261226+DECLSPEC void SDLCALL GPU_Line(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color);
1225122712261228/*! Renders a colored arc curve (circle segment).
12271229 * \param target The destination render target
···12321234 * \param end_angle The angle to end at, in degrees. Measured clockwise from the positive x-axis.
12331235 * \param color The color of the shape to render
12341236 */
12351235-void GPU_Arc(GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color);
12371237+DECLSPEC void SDLCALL GPU_Arc(GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color);
1236123812371239/*! Renders a colored filled arc (circle segment / pie piece).
12381240 * \param target The destination render target
···12431245 * \param end_angle The angle to end at, in degrees. Measured clockwise from the positive x-axis.
12441246 * \param color The color of the shape to render
12451247 */
12461246-void GPU_ArcFilled(GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color);
12481248+DECLSPEC void SDLCALL GPU_ArcFilled(GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color);
1247124912481250/*! Renders a colored circle outline.
12491251 * \param target The destination render target
···12521254 * \param radius The radius of the circle / distance from the center point that rendering will occur
12531255 * \param color The color of the shape to render
12541256 */
12551255-void GPU_Circle(GPU_Target* target, float x, float y, float radius, SDL_Color color);
12571257+DECLSPEC void SDLCALL GPU_Circle(GPU_Target* target, float x, float y, float radius, SDL_Color color);
1256125812571259/*! Renders a colored filled circle.
12581260 * \param target The destination render target
···12611263 * \param radius The radius of the circle / distance from the center point that rendering will occur
12621264 * \param color The color of the shape to render
12631265 */
12641264-void GPU_CircleFilled(GPU_Target* target, float x, float y, float radius, SDL_Color color);
12661266+DECLSPEC void SDLCALL GPU_CircleFilled(GPU_Target* target, float x, float y, float radius, SDL_Color color);
1265126712661268/*! Renders a colored ellipse outline.
12671269 * \param target The destination render target
···12721274 * \param degrees The angle to rotate the ellipse
12731275 * \param color The color of the shape to render
12741276 */
12751275-void GPU_Ellipse(GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color);
12771277+DECLSPEC void SDLCALL GPU_Ellipse(GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color);
1276127812771279/*! Renders a colored filled ellipse.
12781280 * \param target The destination render target
···12831285 * \param degrees The angle to rotate the ellipse
12841286 * \param color The color of the shape to render
12851287 */
12861286-void GPU_EllipseFilled(GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color);
12881288+DECLSPEC void SDLCALL GPU_EllipseFilled(GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color);
1287128912881290/*! Renders a colored annular sector outline (ring segment).
12891291 * \param target The destination render target
···12951297 * \param end_angle The angle to end at, in degrees. Measured clockwise from the positive x-axis.
12961298 * \param color The color of the shape to render
12971299 */
12981298-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);
13001300+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);
1299130113001302/*! Renders a colored filled annular sector (ring segment).
13011303 * \param target The destination render target
···13071309 * \param end_angle The angle to end at, in degrees. Measured clockwise from the positive x-axis.
13081310 * \param color The color of the shape to render
13091311 */
13101310-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);
13121312+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);
1311131313121314/*! Renders a colored triangle outline.
13131315 * \param target The destination render target
···13191321 * \param y3 y-coord of third point
13201322 * \param color The color of the shape to render
13211323 */
13221322-void GPU_Tri(GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color);
13241324+DECLSPEC void SDLCALL GPU_Tri(GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color);
1323132513241326/*! Renders a colored filled triangle.
13251327 * \param target The destination render target
···13311333 * \param y3 y-coord of third point
13321334 * \param color The color of the shape to render
13331335 */
13341334-void GPU_TriFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color);
13361336+DECLSPEC void SDLCALL GPU_TriFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color);
1335133713361338/*! Renders a colored rectangle outline.
13371339 * \param target The destination render target
···13411343 * \param y2 y-coord of bottom-right corner
13421344 * \param color The color of the shape to render
13431345 */
13441344-void GPU_Rectangle(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color);
13461346+DECLSPEC void SDLCALL GPU_Rectangle(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color);
1345134713461348/*! Renders a colored filled rectangle.
13471349 * \param target The destination render target
···13511353 * \param y2 y-coord of bottom-right corner
13521354 * \param color The color of the shape to render
13531355 */
13541354-void GPU_RectangleFilled(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color);
13561356+DECLSPEC void SDLCALL GPU_RectangleFilled(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color);
1355135713561358/*! Renders a colored rounded (filleted) rectangle outline.
13571359 * \param target The destination render target
···13621364 * \param radius The radius of the corners
13631365 * \param color The color of the shape to render
13641366 */
13651365-void GPU_RectangleRound(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color);
13671367+DECLSPEC void SDLCALL GPU_RectangleRound(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color);
1366136813671369/*! Renders a colored filled rounded (filleted) rectangle.
13681370 * \param target The destination render target
···13731375 * \param radius The radius of the corners
13741376 * \param color The color of the shape to render
13751377 */
13761376-void GPU_RectangleRoundFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color);
13781378+DECLSPEC void SDLCALL GPU_RectangleRoundFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color);
1377137913781380/*! Renders a colored polygon outline. The vertices are expected to define a convex polygon.
13791381 * \param target The destination render target
···13811383 * \param vertices An array of vertex positions stored as interlaced x and y coords, e.g. {x1, y1, x2, y2, ...}
13821384 * \param color The color of the shape to render
13831385 */
13841384-void GPU_Polygon(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color);
13861386+DECLSPEC void SDLCALL GPU_Polygon(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color);
1385138713861388/*! Renders a colored filled polygon. The vertices are expected to define a convex polygon.
13871389 * \param target The destination render target
···13891391 * \param vertices An array of vertex positions stored as interlaced x and y coords, e.g. {x1, y1, x2, y2, ...}
13901392 * \param color The color of the shape to render
13911393 */
13921392-void GPU_PolygonFilled(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color);
13941394+DECLSPEC void SDLCALL GPU_PolygonFilled(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color);
1393139513941396// End of Shapes
13951397/*! @} */
···14051407 * \see GPU_AttachShader
14061408 * \see GPU_LinkShaderProgram
14071409 */
14081408-Uint32 GPU_CreateShaderProgram(void);
14101410+DECLSPEC Uint32 SDLCALL GPU_CreateShaderProgram(void);
1409141114101412/*! Deletes a shader program. */
14111411-void GPU_FreeShaderProgram(Uint32 program_object);
14131413+DECLSPEC void SDLCALL GPU_FreeShaderProgram(Uint32 program_object);
1412141414131415/*! Loads shader source from an SDL_RWops, compiles it, and returns the new shader object. */
14141414-Uint32 GPU_CompileShader_RW(GPU_ShaderEnum shader_type, SDL_RWops* shader_source);
14161416+DECLSPEC Uint32 SDLCALL GPU_CompileShader_RW(GPU_ShaderEnum shader_type, SDL_RWops* shader_source);
1415141714161418/*! Compiles shader source and returns the new shader object. */
14171417-Uint32 GPU_CompileShader(GPU_ShaderEnum shader_type, const char* shader_source);
14191419+DECLSPEC Uint32 SDLCALL GPU_CompileShader(GPU_ShaderEnum shader_type, const char* shader_source);
1418142014191421/*! Loads shader source from a file, compiles it, and returns the new shader object. */
14201420-Uint32 GPU_LoadShader(GPU_ShaderEnum shader_type, const char* filename);
14221422+DECLSPEC Uint32 SDLCALL GPU_LoadShader(GPU_ShaderEnum shader_type, const char* filename);
1421142314221424/*! Creates and links a shader program with the given shader objects. */
14231423-Uint32 GPU_LinkShaders(Uint32 shader_object1, Uint32 shader_object2);
14251425+DECLSPEC Uint32 SDLCALL GPU_LinkShaders(Uint32 shader_object1, Uint32 shader_object2);
1424142614251427/*! Deletes a shader object. */
14261426-void GPU_FreeShader(Uint32 shader_object);
14281428+DECLSPEC void SDLCALL GPU_FreeShader(Uint32 shader_object);
1427142914281430/*! Attaches a shader object to a shader program for future linking. */
14291429-void GPU_AttachShader(Uint32 program_object, Uint32 shader_object);
14311431+DECLSPEC void SDLCALL GPU_AttachShader(Uint32 program_object, Uint32 shader_object);
1430143214311433/*! Detaches a shader object from a shader program. */
14321432-void GPU_DetachShader(Uint32 program_object, Uint32 shader_object);
14341434+DECLSPEC void SDLCALL GPU_DetachShader(Uint32 program_object, Uint32 shader_object);
1433143514341436/*! Links a shader program with any attached shader objects. */
14351435-Uint8 GPU_LinkShaderProgram(Uint32 program_object);
14371437+DECLSPEC Uint8 SDLCALL GPU_LinkShaderProgram(Uint32 program_object);
1436143814371439/*! \return The current shader program */
14381438-Uint32 GPU_GetCurrentShaderProgram(void);
14401440+DECLSPEC Uint32 SDLCALL GPU_GetCurrentShaderProgram(void);
1439144114401442/*! Returns 1 if the given shader program is a default shader for the current context, 0 otherwise. */
14411441-Uint8 GPU_IsDefaultShaderProgram(Uint32 program_object);
14431443+DECLSPEC Uint8 SDLCALL GPU_IsDefaultShaderProgram(Uint32 program_object);
1442144414431445/*! 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. */
14441444-void GPU_ActivateShaderProgram(Uint32 program_object, GPU_ShaderBlock* block);
14461446+DECLSPEC void SDLCALL GPU_ActivateShaderProgram(Uint32 program_object, GPU_ShaderBlock* block);
1445144714461448/*! Deactivates the current shader program (activates program 0). */
14471447-void GPU_DeactivateShaderProgram(void);
14491449+DECLSPEC void SDLCALL GPU_DeactivateShaderProgram(void);
1448145014491451/*! Returns the last shader log message. */
14501450-const char* GPU_GetShaderMessage(void);
14521452+DECLSPEC const char* SDLCALL GPU_GetShaderMessage(void);
1451145314521454/*! Returns an integer representing the location of the specified attribute shader variable. */
14531453-int GPU_GetAttributeLocation(Uint32 program_object, const char* attrib_name);
14551455+DECLSPEC int SDLCALL GPU_GetAttributeLocation(Uint32 program_object, const char* attrib_name);
1454145614551457/*! Returns a filled GPU_AttributeFormat object. */
14561456-GPU_AttributeFormat GPU_MakeAttributeFormat(int num_elems_per_vertex, GPU_TypeEnum type, Uint8 normalize, int stride_bytes, int offset_bytes);
14581458+DECLSPEC GPU_AttributeFormat SDLCALL GPU_MakeAttributeFormat(int num_elems_per_vertex, GPU_TypeEnum type, Uint8 normalize, int stride_bytes, int offset_bytes);
1457145914581460/*! Returns a filled GPU_Attribute object. */
14591459-GPU_Attribute GPU_MakeAttribute(int location, void* values, GPU_AttributeFormat format);
14611461+DECLSPEC GPU_Attribute SDLCALL GPU_MakeAttribute(int location, void* values, GPU_AttributeFormat format);
1460146214611463/*! Returns an integer representing the location of the specified uniform shader variable. */
14621462-int GPU_GetUniformLocation(Uint32 program_object, const char* uniform_name);
14641464+DECLSPEC int SDLCALL GPU_GetUniformLocation(Uint32 program_object, const char* uniform_name);
1463146514641466/*! Loads the given shader program's built-in attribute and uniform locations. */
14651465-GPU_ShaderBlock GPU_LoadShaderBlock(Uint32 program_object, const char* position_name, const char* texcoord_name, const char* color_name, const char* modelViewMatrix_name);
14671467+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);
1466146814671469/*! Sets the current shader block to use the given attribute and uniform locations. */
14681468-void GPU_SetShaderBlock(GPU_ShaderBlock block);
14701470+DECLSPEC void SDLCALL GPU_SetShaderBlock(GPU_ShaderBlock block);
1469147114701472/*! Sets the given image unit to the given image so that a custom shader can sample multiple textures.
14711473 \param image The source image/texture. Pass NULL to disable the image unit.
14721474 \param location The uniform location of a texture sampler
14731475 \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. */
14741474-void GPU_SetShaderImage(GPU_Image* image, int location, int image_unit);
14761476+DECLSPEC void SDLCALL GPU_SetShaderImage(GPU_Image* image, int location, int image_unit);
1475147714761478/*! Fills "values" with the value of the uniform shader variable at the given location. */
14771477-void GPU_GetUniformiv(Uint32 program_object, int location, int* values);
14791479+DECLSPEC void SDLCALL GPU_GetUniformiv(Uint32 program_object, int location, int* values);
1478148014791481/*! Sets the value of the integer uniform shader variable at the given location.
14801482 This is equivalent to calling GPU_SetUniformiv(location, 1, 1, &value). */
14811481-void GPU_SetUniformi(int location, int value);
14831483+DECLSPEC void SDLCALL GPU_SetUniformi(int location, int value);
1482148414831485/*! Sets the value of the integer uniform shader variable at the given location. */
14841484-void GPU_SetUniformiv(int location, int num_elements_per_value, int num_values, int* values);
14861486+DECLSPEC void SDLCALL GPU_SetUniformiv(int location, int num_elements_per_value, int num_values, int* values);
1485148714861488/*! Fills "values" with the value of the uniform shader variable at the given location. */
14871487-void GPU_GetUniformuiv(Uint32 program_object, int location, unsigned int* values);
14891489+DECLSPEC void SDLCALL GPU_GetUniformuiv(Uint32 program_object, int location, unsigned int* values);
1488149014891491/*! Sets the value of the unsigned integer uniform shader variable at the given location.
14901492 This is equivalent to calling GPU_SetUniformuiv(location, 1, 1, &value). */
14911491-void GPU_SetUniformui(int location, unsigned int value);
14931493+DECLSPEC void SDLCALL GPU_SetUniformui(int location, unsigned int value);
1492149414931495/*! Sets the value of the unsigned integer uniform shader variable at the given location. */
14941494-void GPU_SetUniformuiv(int location, int num_elements_per_value, int num_values, unsigned int* values);
14961496+DECLSPEC void SDLCALL GPU_SetUniformuiv(int location, int num_elements_per_value, int num_values, unsigned int* values);
1495149714961498/*! Fills "values" with the value of the uniform shader variable at the given location. */
14971497-void GPU_GetUniformfv(Uint32 program_object, int location, float* values);
14991499+DECLSPEC void SDLCALL GPU_GetUniformfv(Uint32 program_object, int location, float* values);
1498150014991501/*! Sets the value of the floating point uniform shader variable at the given location.
15001502 This is equivalent to calling GPU_SetUniformfv(location, 1, 1, &value). */
15011501-void GPU_SetUniformf(int location, float value);
15031503+DECLSPEC void SDLCALL GPU_SetUniformf(int location, float value);
1502150415031505/*! Sets the value of the floating point uniform shader variable at the given location. */
15041504-void GPU_SetUniformfv(int location, int num_elements_per_value, int num_values, float* values);
15061506+DECLSPEC void SDLCALL GPU_SetUniformfv(int location, int num_elements_per_value, int num_values, float* values);
1505150715061508/*! 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. */
15071507-void GPU_GetUniformMatrixfv(Uint32 program_object, int location, float* values);
15091509+DECLSPEC void SDLCALL GPU_GetUniformMatrixfv(Uint32 program_object, int location, float* values);
1508151015091511/*! 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. */
15101510-void GPU_SetUniformMatrixfv(int location, int num_matrices, int num_rows, int num_columns, Uint8 transpose, float* values);
15121512+DECLSPEC void SDLCALL GPU_SetUniformMatrixfv(int location, int num_matrices, int num_rows, int num_columns, Uint8 transpose, float* values);
1511151315121514/*! Sets a constant-value shader attribute that will be used for each rendered vertex. */
15131513-void GPU_SetAttributef(int location, float value);
15151515+DECLSPEC void SDLCALL GPU_SetAttributef(int location, float value);
1514151615151517/*! Sets a constant-value shader attribute that will be used for each rendered vertex. */
15161516-void GPU_SetAttributei(int location, int value);
15181518+DECLSPEC void SDLCALL GPU_SetAttributei(int location, int value);
1517151915181520/*! Sets a constant-value shader attribute that will be used for each rendered vertex. */
15191519-void GPU_SetAttributeui(int location, unsigned int value);
15211521+DECLSPEC void SDLCALL GPU_SetAttributeui(int location, unsigned int value);
1520152215211523/*! Sets a constant-value shader attribute that will be used for each rendered vertex. */
15221522-void GPU_SetAttributefv(int location, int num_elements, float* value);
15241524+DECLSPEC void SDLCALL GPU_SetAttributefv(int location, int num_elements, float* value);
1523152515241526/*! Sets a constant-value shader attribute that will be used for each rendered vertex. */
15251525-void GPU_SetAttributeiv(int location, int num_elements, int* value);
15271527+DECLSPEC void SDLCALL GPU_SetAttributeiv(int location, int num_elements, int* value);
1526152815271529/*! Sets a constant-value shader attribute that will be used for each rendered vertex. */
15281528-void GPU_SetAttributeuiv(int location, int num_elements, unsigned int* value);
15301530+DECLSPEC void SDLCALL GPU_SetAttributeuiv(int location, int num_elements, unsigned int* value);
1529153115301532/*! Enables a shader attribute and sets its source data. */
15311531-void GPU_SetAttributeSource(int num_values, GPU_Attribute source);
15331533+DECLSPEC void SDLCALL GPU_SetAttributeSource(int num_values, GPU_Attribute source);
1532153415331535// End of ShaderInterface
15341536/*! @} */
···15381540}
15391541#endif
1540154215431543+#include "close_code.h"
154115441542154515431546#endif