18 #define SHAPED_WINDOW_X 150 19 #define SHAPED_WINDOW_Y 150 20 #define SHAPED_WINDOW_DIMENSION 640 36 SDL_RenderCopy(renderer,texture,&texture_dimensions,&texture_dimensions);
41 int main(
int argc,
char** argv)
51 int event_pending = 0;
53 unsigned int current_picture;
72 num_pictures = argc - 1;
78 for(i=0;i<num_pictures;i++)
80 for(i=0;i<num_pictures;i++) {
82 pictures[
i].
name = argv[i+1];
85 for(j=0;j<num_pictures;j++)
110 for(i=0;i<num_pictures;i++)
120 for(i=0;i<num_pictures;i++)
128 for(i=0;i<num_pictures;i++)
130 for(i=0;i<num_pictures;i++) {
134 for(j=0;j<num_pictures;i++)
137 for(i=0;i<num_pictures;i++)
153 texture_dimensions.
h = 0;
154 texture_dimensions.
w = 0;
155 texture_dimensions.
x = 0;
156 texture_dimensions.
y = 0;
161 while(should_exit == 0) {
163 if(event_pending == 1) {
173 current_picture += 1;
174 if(current_picture >= num_pictures)
177 SDL_QueryTexture(pictures[current_picture].texture,(
Uint32 *)&pixelFormat,(
int *)&access,&texture_dimensions.
w,&texture_dimensions.
h);
179 SDL_SetWindowShape(window,pictures[current_picture].surface,&pictures[current_picture].mode);
185 render(renderer,pictures[current_picture].texture,texture_dimensions);
190 for(i=0;i<num_pictures;i++)
196 for(i=0;i<num_pictures;i++)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
#define SDL_SetWindowShape
#define SDL_LoadBMP(file)
static SDL_Window * window
GLenum GLenum GLuint texture
#define SDL_SetWindowSize
A collection of pixels used in software blitting.
GLuint const GLchar * name
#define SDL_ISPIXELFORMAT_ALPHA(format)
uint32_t Uint32
An unsigned 32-bit integer type.
GLuint GLint GLboolean GLint GLenum access
void render(SDL_Renderer *renderer, SDL_Texture *texture, SDL_Rect texture_dimensions)
#define SDL_CreateTextureFromSurface
static SDL_Renderer * renderer
uint8_t Uint8
An unsigned 8-bit integer type.
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
SDL_WindowShapeParams parameters
Window-shape parameters.
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
#define SDL_LogSetPriority
A binarized alpha cutoff with a given integer value.
#define SDL_DestroyTexture
#define SDL_CreateShapedWindow
The type used to identify a window.
#define SHAPED_WINDOW_DIMENSION
Uint8 binarizationCutoff
a cutoff alpha value for binarization of the window shape's alpha channel.
A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents...
#define SDL_SetRenderDrawColor
int main(int argc, char **argv)
#define SDL_DestroyRenderer
WindowShapeMode mode
The mode of these window-shape parameters.
#define SDL_DestroyWindow
#define SDL_SetWindowPosition
#define SDL_CreateRenderer
A rectangle, with the origin at the upper left.
#define SDL_RenderPresent