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
56ab3ca5
Commit
56ab3ca5
authored
Aug 02, 2010
by
egottlieb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Worked on Windows implementation and the quad-trees.
parent
c33852e9
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
125 additions
and
4 deletions
+125
-4
tests.sln
VisualC/tests/tests.sln
+109
-0
testshape.vcxproj.user
VisualC/tests/testshape/testshape.vcxproj.user
+5
-0
SDL_shape.c
src/video/SDL_shape.c
+3
-0
SDL_win32shape.c
src/video/win32/SDL_win32shape.c
+8
-4
No files found.
VisualC/tests/tests.sln
View file @
56ab3ca5
This diff is collapsed.
Click to expand it.
VisualC/tests/testshape/testshape.vcxproj.user
View file @
56ab3ca5
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"4.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<PropertyGroup>
<ShowAllFiles>
true
</ShowAllFiles>
<LocalDebuggerCommandArguments
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
"C:\Users\Eli\My Programs\test\shapes\p16_shape24.bmp"
</LocalDebuggerCommandArguments>
<DebuggerFlavor
Condition=
"'$(Configuration)|$(Platform)'=='Debug|Win32'"
>
WindowsLocalDebugger
</DebuggerFlavor>
</PropertyGroup>
</Project>
\ No newline at end of file
src/video/SDL_shape.c
View file @
56ab3ca5
...
...
@@ -131,6 +131,9 @@ SDL_ShapeTree* RecursivelyCalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surfac
case
(
2
):
pixel_value
=
*
(
Uint16
*
)
pixel
;
break
;
case
(
3
):
pixel_value
=
*
(
Uint32
*
)
pixel
&
(
~
mask
->
format
->
Amask
);
break
;
case
(
4
):
pixel_value
=
*
(
Uint32
*
)
pixel
;
break
;
...
...
src/video/win32/SDL_win32shape.c
View file @
56ab3ca5
...
...
@@ -20,7 +20,7 @@
eligottlieb@gmail.com
*/
#include "SDL_win32shape.h"
#include "SDL_win32shape.h"
#include "SDL_win32video.h"
SDL_WindowShaper
*
Win32_CreateShaper
(
SDL_Window
*
window
)
{
...
...
@@ -30,6 +30,8 @@ SDL_WindowShaper* Win32_CreateShaper(SDL_Window * window) {
result
->
mode
.
mode
=
ShapeModeDefault
;
result
->
mode
.
parameters
.
binarizationCutoff
=
1
;
result
->
usershownflag
=
0
;
result
->
driverdata
=
(
SDL_ShapeData
*
)
SDL_malloc
(
sizeof
(
SDL_ShapeData
));
((
SDL_ShapeData
*
)
result
->
driverdata
)
->
mask_tree
=
NULL
;
//Put some driver-data here.
window
->
shaper
=
result
;
resized_properly
=
Win32_ResizeWindowShape
(
window
);
...
...
@@ -51,15 +53,17 @@ void CombineRectRegions(SDL_ShapeTree* node, void* closure) {
int
Win32_SetWindowShape
(
SDL_WindowShaper
*
shaper
,
SDL_Surface
*
shape
,
SDL_WindowShapeMode
*
shapeMode
)
{
SDL_ShapeData
*
data
;
HRGN
mask_region
;
SDL_WindowData
*
windowdata
;
SDL_WindowData
*
windowdata
;
HWND
hwnd
;
if
(
shaper
==
NULL
||
shape
==
NULL
)
return
SDL_INVALID_SHAPE_ARGUMENT
;
if
(
!
SDL_ISPIXELFORMAT_ALPHA
(
SDL_MasksToPixelFormatEnum
(
shape
->
format
->
BitsPerPixel
,
shape
->
format
->
Rmask
,
shape
->
format
->
Gmask
,
shape
->
format
->
Bmask
,
shape
->
format
->
Amask
))
&&
shapeMode
->
mode
!=
ShapeModeColorKey
||
shape
->
w
!=
shaper
->
window
->
w
||
shape
->
h
!=
shaper
->
window
->
h
)
if
(
shape
->
format
->
Amask
==
0
&&
shapeMode
->
mode
!=
ShapeModeColorKey
||
shape
->
w
!=
shaper
->
window
->
w
||
shape
->
h
!=
shaper
->
window
->
h
)
return
SDL_INVALID_SHAPE_ARGUMENT
;
data
=
(
SDL_ShapeData
*
)
shaper
->
driverdata
;
if
(
data
->
mask_tree
!=
NULL
)
SDL_FreeShapeTree
(
&
data
->
mask_tree
);
data
->
mask_tree
=
SDL_CalculateShapeTree
(
*
shapeMode
,
shape
,
SDL_FALSE
);
/*
...
...
@@ -72,7 +76,7 @@ int Win32_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowS
/*
* Set the new region mask for the window
*/
windowdata
=
(
SDL_WindowData
*
)(
shaper
->
window
->
driverdata
);
windowdata
=
(
SDL_WindowData
*
)(
shaper
->
window
->
driverdata
);
hwnd
=
windowdata
->
hwnd
;
SetWindowRgn
(
hwnd
,
mask_region
,
TRUE
);
...
...
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