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;
74 for(i=0;i<num_pictures;i++)
76 for(i=0;i<num_pictures;i++) {
78 pictures[
i].
name = argv[i+1];
81 for(j=0;j<num_pictures;j++)
106 for(i=0;i<num_pictures;i++)
116 for(i=0;i<num_pictures;i++)
124 for(i=0;i<num_pictures;i++)
126 for(i=0;i<num_pictures;i++) {
130 for(j=0;j<num_pictures;i++)
133 for(i=0;i<num_pictures;i++)
149 texture_dimensions.
h = 0;
150 texture_dimensions.
w = 0;
151 texture_dimensions.
x = 0;
152 texture_dimensions.
y = 0;
157 while(should_exit == 0) {
159 if(event_pending == 1) {
169 current_picture += 1;
170 if(current_picture >= num_pictures)
173 SDL_QueryTexture(pictures[current_picture].texture,(
Uint32 *)&pixelFormat,(
int *)&access,&texture_dimensions.
w,&texture_dimensions.
h);
175 SDL_SetWindowShape(window,pictures[current_picture].surface,&pictures[current_picture].mode);
181 render(renderer,pictures[current_picture].texture,texture_dimensions);
186 for(i=0;i<num_pictures;i++)
192 for(i=0;i<num_pictures;i++)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
#define SDL_SetWindowShape
uint32_t Uint32
An unsigned 32-bit integer type.
#define SDL_LoadBMP(file)
GLenum GLenum GLuint texture
#define SDL_SetWindowSize
A collection of pixels used in software blitting.
GLuint const GLchar * name
#define SDL_ISPIXELFORMAT_ALPHA(format)
GLuint GLint GLboolean GLint GLenum access
void render(SDL_Renderer *renderer, SDL_Texture *texture, SDL_Rect texture_dimensions)
#define SDL_CreateTextureFromSurface
uint8_t Uint8
An unsigned 8-bit integer type.
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
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)