Making the API simpler, scaling is always defined as linear interpolation and should be supported as much as possible on all renderers.

This commit is contained in:
Sam Lantinga
2011-01-31 22:44:43 -08:00
parent 096a6b8d79
commit 471a85fb52
22 changed files with 9 additions and 544 deletions

View File

@@ -208,14 +208,6 @@ typedef enum
SDL_GRAB_ON = 1
} SDL_GrabMode;
typedef enum
{
SDL_TEXTURESCALEMODE_NONE = SDL_SCALEMODE_NONE,
SDL_TEXTURESCALEMODE_FAST = SDL_SCALEMODE_FAST,
SDL_TEXTURESCALEMODE_SLOW = SDL_SCALEMODE_SLOW,
SDL_TEXTURESCALEMODE_BEST = SDL_SCALEMODE_BEST
} SDL_TextureScaleMode;
struct SDL_SysWMinfo;
/**

View File

@@ -1,69 +0,0 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2010 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/**
* \file SDL_scalemode.h
*
* Header file declaring the SDL_ScaleMode enumeration
*/
#ifndef _SDL_scalemode_h
#define _SDL_scalemode_h
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
extern "C" {
/* *INDENT-ON* */
#endif
/**
* \brief The texture scale mode used in SDL_RenderCopy().
*/
typedef enum
{
SDL_SCALEMODE_NONE = 0x00000000, /**< No scaling, rectangles must
match dimensions */
SDL_SCALEMODE_FAST = 0x00000001, /**< Point sampling or
equivalent algorithm */
SDL_SCALEMODE_SLOW = 0x00000002, /**< Linear filtering or
equivalent algorithm */
SDL_SCALEMODE_BEST = 0x00000004 /**< Bicubic filtering or
equivalent algorithm */
} SDL_ScaleMode;
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif
#include "close_code.h"
#endif /* _SDL_video_h */
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -33,7 +33,6 @@
#include "SDL_pixels.h"
#include "SDL_rect.h"
#include "SDL_blendmode.h"
#include "SDL_scalemode.h"
#include "SDL_rwops.h"
#include "begin_code.h"
@@ -317,37 +316,6 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
SDL_BlendMode *blendMode);
/**
* \brief Set the scale mode used for blit operations.
*
* \param surface The surface to update.
* \param scaleMode ::SDL_ScaleMode to use for blit scaling.
*
* \return 0 on success, or -1 if the surface is not valid or the scale mode is
* not supported.
*
* \note If the scale mode is not supported, the closest supported mode is
* chosen. Currently only ::SDL_TEXTURESCALEMODE_FAST is supported on
* surfaces.
*
* \sa SDL_GetSurfaceScaleMode()
*/
extern DECLSPEC int SDLCALL SDL_SetSurfaceScaleMode(SDL_Surface * surface,
SDL_ScaleMode scaleMode);
/**
* \brief Get the scale mode used for blit operations.
*
* \param surface The surface to query.
* \param scaleMode A pointer filled in with the current scale mode.
*
* \return 0 on success, or -1 if the surface is not valid.
*
* \sa SDL_SetSurfaceScaleMode()
*/
extern DECLSPEC int SDLCALL SDL_GetSurfaceScaleMode(SDL_Surface * surface,
SDL_ScaleMode *scaleMode);
/**
* Sets the clipping rectangle for the destination surface in a blit.
*

View File

@@ -33,7 +33,6 @@
#include "SDL_pixels.h"
#include "SDL_rect.h"
#include "SDL_blendmode.h"
#include "SDL_scalemode.h"
#include "SDL_surface.h"
#include "begin_code.h"
@@ -189,7 +188,6 @@ typedef struct SDL_RendererInfo
Uint32 flags; /**< Supported ::SDL_RendererFlags */
Uint32 mod_modes; /**< A mask of supported channel modulation */
Uint32 blend_modes; /**< A mask of supported blend modes */
Uint32 scale_modes; /**< A mask of supported scale modes */
Uint32 num_texture_formats; /**< The number of available texture formats */
Uint32 texture_formats[50]; /**< The available texture formats */
int max_texture_width; /**< The maximimum texture width */
@@ -968,36 +966,6 @@ extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture,
extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
SDL_BlendMode *blendMode);
/**
* \brief Set the scale mode used for texture copy operations.
*
* \param texture The texture to update.
* \param scaleMode ::SDL_ScaleMode to use for texture scaling.
*
* \return 0 on success, or -1 if the texture is not valid or the scale mode is
* not supported.
*
* \note If the scale mode is not supported, the closest supported mode is
* chosen.
*
* \sa SDL_GetTextureScaleMode()
*/
extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture,
SDL_ScaleMode scaleMode);
/**
* \brief Get the scale mode used for texture copy operations.
*
* \param texture The texture to query.
* \param scaleMode A pointer filled in with the current scale mode.
*
* \return 0 on success, or -1 if the texture is not valid.
*
* \sa SDL_SetTextureScaleMode()
*/
extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture,
SDL_ScaleMode *scaleMode);
/**
* \brief Update the given texture rectangle with new pixel data.
*