Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libSDL
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
libSDL
Commits
21d029da
Commit
21d029da
authored
Jul 15, 2010
by
Eli Gottlieb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added in Visual Studio patch.
parent
20c4883d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
SDL_VS2010.sln
VisualC/SDL_VS2010.sln
+2
-2
SDL_shape.c
src/video/SDL_shape.c
+17
-7
No files found.
VisualC/SDL_VS2010.sln
View file @
21d029da
...
...
@@ -2,9 +2,9 @@ Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{CE748C1F-3C21-4825-AA6A-F895A023F7E7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL", "SDL\SDL_VS20
08
.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL", "SDL\SDL_VS20
10
.vcxproj", "{81CE8DAF-EBB2-4761-8E45-B71ABCCA8C68}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDLmain", "SDLmain\SDLmain_VS20
08
.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDLmain", "SDLmain\SDLmain_VS20
10
.vcxproj", "{DA956FD3-E142-46F2-9DD5-C78BEBB56B7A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "automated", "tests\automated\automated.vcxproj", "{DDD710DB-EC7B-4CCB-BD75-535D401A2FE0}"
EndProject
...
...
src/video/SDL_shape.c
View file @
21d029da
...
...
@@ -30,11 +30,21 @@
SDL_Window
*
SDL_CreateShapedWindow
(
const
char
*
title
,
unsigned
int
x
,
unsigned
int
y
,
unsigned
int
w
,
unsigned
int
h
,
Uint32
flags
)
{
SDL_Window
*
result
=
SDL_CreateWindow
(
title
,
x
,
y
,
w
,
h
,
SDL_WINDOW_BORDERLESS
|
flags
&
!
SDL_WINDOW_FULLSCREEN
&
!
SDL_WINDOW_SHOWN
);
result
->
shaper
=
result
->
display
->
device
->
shape_driver
.
CreateShaper
(
result
);
result
->
shaper
->
usershownflag
=
flags
&
SDL_WINDOW_SHOWN
;
result
->
shaper
->
alphacutoff
=
1
;
result
->
shaper
->
hasshape
=
SDL_FALSE
;
return
result
;
if
(
result
!=
NULL
)
{
result
->
shaper
=
result
->
display
->
device
->
shape_driver
.
CreateShaper
(
result
);
if
(
result
->
shaper
!=
NULL
)
{
result
->
shaper
->
usershownflag
=
flags
&
SDL_WINDOW_SHOWN
;
result
->
shaper
->
alphacutoff
=
1
;
result
->
shaper
->
hasshape
=
SDL_FALSE
;
return
result
;
}
else
{
SDL_DestroyWindow
(
result
);
return
NULL
;
}
}
else
return
NULL
;
}
SDL_bool
SDL_IsShapedWindow
(
const
SDL_Window
*
window
)
{
...
...
@@ -55,10 +65,10 @@ void SDL_CalculateShapeBitmap(Uint8 alphacutoff,SDL_Surface *shape,Uint8* bitmap
SDL_LockSurface
(
shape
);
for
(
x
=
0
;
x
<
shape
->
w
;
x
++
)
for
(
y
=
0
;
y
<
shape
->
h
;
y
++
)
{
pixel
=
shape
->
pixels
+
(
y
*
shape
->
pitch
)
+
(
x
*
shape
->
format
->
BytesPerPixel
);
pixel
=
(
Uint8
*
)(
shape
->
pixels
)
+
(
y
*
shape
->
pitch
)
+
(
x
*
shape
->
format
->
BytesPerPixel
);
alpha
=
0
;
SDL_GetRGBA
(
*
(
Uint32
*
)
pixel
,
shape
->
format
,
&
r
,
&
g
,
&
b
,
&
alpha
);
Uint32
bitmap_pixel
=
y
*
shape
->
w
+
x
;
bitmap_pixel
=
y
*
shape
->
w
+
x
;
bitmap
[
bitmap_pixel
/
ppb
]
|=
(
alpha
>=
alphacutoff
?
value
:
0
)
<<
((
ppb
-
1
)
-
(
bitmap_pixel
%
ppb
));
}
if
(
SDL_MUSTLOCK
(
shape
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment