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
8f1459d9
Commit
8f1459d9
authored
Aug 03, 2010
by
egottlieb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Got basic, pre-actually-writing-anything Cocoa to build.
parent
34bbabf0
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
17 deletions
+63
-17
project.pbxproj
Xcode/SDL/SDL.xcodeproj/project.pbxproj
+28
-0
SDL_revision.h
include/SDL_revision.h
+1
-1
SDL_shape.c
src/video/SDL_shape.c
+1
-1
SDL_cocoashape.h
src/video/cocoa/SDL_cocoashape.h
+15
-3
SDL_cocoashape.m
src/video/cocoa/SDL_cocoashape.m
+17
-12
SDL_cocoavideo.m
src/video/cocoa/SDL_cocoavideo.m
+1
-0
No files found.
Xcode/SDL/SDL.xcodeproj/project.pbxproj
View file @
8f1459d9
...
...
@@ -450,6 +450,13 @@
04F2AF671104AC0800D6DDF7
/* SDL_assert.c in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04F2AF651104AC0800D6DDF7
/* SDL_assert.c */
;
};
04F2AF691104AC4500D6DDF7
/* SDL_assert.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04F2AF681104AC4500D6DDF7
/* SDL_assert.h */
;
};
04F2AF6A1104AC4500D6DDF7
/* SDL_assert.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04F2AF681104AC4500D6DDF7
/* SDL_assert.h */
;
};
4537737D1207C4CE002F0F45
/* SDL_shape_internals.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4537737B1207C4CE002F0F45
/* SDL_shape_internals.h */
;
};
4537737E1207C4CE002F0F45
/* SDL_shape.c in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
4537737C1207C4CE002F0F45
/* SDL_shape.c */
;
};
453773821207C518002F0F45
/* SDL_shape.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
453773811207C518002F0F45
/* SDL_shape.h */
;
};
453773891207C5A2002F0F45
/* SDL_cocoashape.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
453773871207C5A2002F0F45
/* SDL_cocoashape.h */
;
};
4537738A1207C5A2002F0F45
/* SDL_cocoashape.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
453773881207C5A2002F0F45
/* SDL_cocoashape.m */
;
};
453773921207C6E9002F0F45
/* SDL_x11shape.c in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
453773901207C6E9002F0F45
/* SDL_x11shape.c */
;
};
453773931207C6E9002F0F45
/* SDL_x11shape.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
453773911207C6E9002F0F45
/* SDL_x11shape.h */
;
};
BECDF62E0761BA81005FE872
/* SDL_audio.c in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
01538330006D78D67F000001
/* SDL_audio.c */
;
};
BECDF62F0761BA81005FE872
/* SDL_audiocvt.c in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
01538331006D78D67F000001
/* SDL_audiocvt.c */
;
};
BECDF6300761BA81005FE872
/* SDL_audiodev.c in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
01538332006D78D67F000001
/* SDL_audiodev.c */
;
};
...
...
@@ -825,6 +832,13 @@
0C5AF5FD01191D2B7F000001
/* SDL_version.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
30
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
SDL_version.h
;
path
=
../../include/SDL_version.h
;
sourceTree
=
SOURCE_ROOT
;
};
0C5AF5FE01191D2B7F000001
/* SDL_video.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
30
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
SDL_video.h
;
path
=
../../include/SDL_video.h
;
sourceTree
=
SOURCE_ROOT
;
};
0C5AF5FF01191D2B7F000001
/* SDL.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
30
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
SDL.h
;
path
=
../../include/SDL.h
;
sourceTree
=
SOURCE_ROOT
;
};
4537737B1207C4CE002F0F45
/* SDL_shape_internals.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
SDL_shape_internals.h
;
sourceTree
=
"<group>"
;
};
4537737C1207C4CE002F0F45
/* SDL_shape.c */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.c
;
path
=
SDL_shape.c
;
sourceTree
=
"<group>"
;
};
453773811207C518002F0F45
/* SDL_shape.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
SDL_shape.h
;
path
=
../../include/SDL_shape.h
;
sourceTree
=
SOURCE_ROOT
;
};
453773871207C5A2002F0F45
/* SDL_cocoashape.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
SDL_cocoashape.h
;
sourceTree
=
"<group>"
;
};
453773881207C5A2002F0F45
/* SDL_cocoashape.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
SDL_cocoashape.m
;
sourceTree
=
"<group>"
;
};
453773901207C6E9002F0F45
/* SDL_x11shape.c */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.c
;
path
=
SDL_x11shape.c
;
sourceTree
=
"<group>"
;
};
453773911207C6E9002F0F45
/* SDL_x11shape.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
SDL_x11shape.h
;
sourceTree
=
"<group>"
;
};
B24DA50405A88D52006B9F1C
/* SDL_cpuinfo.c */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
30
;
lastKnownFileType
=
sourcecode.c.c
;
path
=
SDL_cpuinfo.c
;
sourceTree
=
"<group>"
;
};
B29A290D04E5B28700A80002
/* SDL_loadso.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
30
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
SDL_loadso.h
;
path
=
../../include/SDL_loadso.h
;
sourceTree
=
"<group>"
;
};
B2CF8DC405C444E400E5DC7F
/* SDL_cpuinfo.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
30
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
SDL_cpuinfo.h
;
path
=
../../include/SDL_cpuinfo.h
;
sourceTree
=
SOURCE_ROOT
;
};
...
...
@@ -1043,6 +1057,8 @@
00CFA70B106B498A00758660
/* SDL_cocoamouse.m */
,
00CFA70C106B498A00758660
/* SDL_cocoaopengl.h */
,
00CFA70D106B498A00758660
/* SDL_cocoaopengl.m */
,
453773871207C5A2002F0F45
/* SDL_cocoashape.h */
,
453773881207C5A2002F0F45
/* SDL_cocoashape.m */
,
00CFA70E106B498A00758660
/* SDL_cocoavideo.h */
,
00CFA70F106B498A00758660
/* SDL_cocoavideo.m */
,
00CFA710106B498A00758660
/* SDL_cocoawindow.h */
,
...
...
@@ -1087,6 +1103,8 @@
00CFA72B106B498B00758660
/* SDL_x11opengles.h */
,
00CFA72C106B498B00758660
/* SDL_x11render.c */
,
00CFA72D106B498B00758660
/* SDL_x11render.h */
,
453773901207C6E9002F0F45
/* SDL_x11shape.c */
,
453773911207C6E9002F0F45
/* SDL_x11shape.h */
,
00CFA72E106B498B00758660
/* SDL_x11sym.h */
,
00CFA72F106B498B00758660
/* SDL_x11video.c */
,
00CFA730106B498B00758660
/* SDL_x11video.h */
,
...
...
@@ -1401,6 +1419,8 @@
00CFA80E106B49B600758660
/* SDL_renderer_sw.h */
,
00CFA80F106B49B600758660
/* SDL_RLEaccel_c.h */
,
00CFA810106B49B600758660
/* SDL_RLEaccel.c */
,
4537737C1207C4CE002F0F45
/* SDL_shape.c */
,
4537737B1207C4CE002F0F45
/* SDL_shape_internals.h */
,
00CFA811106B49B600758660
/* SDL_stretch.c */
,
00CFA812106B49B600758660
/* SDL_surface.c */
,
00CFA813106B49B600758660
/* SDL_sysvideo.h */
,
...
...
@@ -1452,6 +1472,7 @@
00A6EBD91078D569001EEA06
/* SDL_revision.h */
,
0C5AF5F801191D2B7F000001
/* SDL_rwops.h */
,
00CFA680106B44CE00758660
/* SDL_scancode.h */
,
453773811207C518002F0F45
/* SDL_shape.h */
,
00162D3909BD1FA90037C8D0
/* SDL_stdinc.h */
,
00CFA681106B44CE00758660
/* SDL_surface.h */
,
0C5AF5F901191D2B7F000001
/* SDL_syswm.h */
,
...
...
@@ -1743,6 +1764,10 @@
00A6EBDA1078D569001EEA06
/* SDL_revision.h in Headers */
,
04F2AF691104AC4500D6DDF7
/* SDL_assert.h in Headers */
,
006E95B011952992001DE610
/* SDL_rwopsbundlesupport.h in Headers */
,
4537737D1207C4CE002F0F45
/* SDL_shape_internals.h in Headers */
,
453773821207C518002F0F45
/* SDL_shape.h in Headers */
,
453773891207C5A2002F0F45
/* SDL_cocoashape.h in Headers */
,
453773931207C6E9002F0F45
/* SDL_x11shape.h in Headers */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
...
...
@@ -2202,6 +2227,9 @@
04DB838D10FD8C81000519B5
/* SDL_drawrect.c in Sources */
,
04F2AF661104AC0800D6DDF7
/* SDL_assert.c in Sources */
,
006E95B111952992001DE610
/* SDL_rwopsbundlesupport.m in Sources */
,
4537737E1207C4CE002F0F45
/* SDL_shape.c in Sources */
,
4537738A1207C5A2002F0F45
/* SDL_cocoashape.m in Sources */
,
453773921207C6E9002F0F45
/* SDL_x11shape.c in Sources */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
};
...
...
include/SDL_revision.h
View file @
8f1459d9
#define SDL_REVISION "hg-45
16:eb433f0d2ac5
"
#define SDL_REVISION "hg-45
26:d532a5a114cd
"
src/video/SDL_shape.c
View file @
8f1459d9
...
...
@@ -27,7 +27,7 @@
#include "SDL_pixels.h"
#include "SDL_surface.h"
#include "SDL_shape.h"
#include "
../src/video/
SDL_shape_internals.h"
#include "SDL_shape_internals.h"
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
);
...
...
src/video/cocoa/SDL_cocoashape.h
View file @
8f1459d9
...
...
@@ -20,14 +20,26 @@
eligottlieb@gmail.com
*/
#include "SDL_config.h"
#ifndef _SDL_cocoashape_h
#define _SDL_cocoashape_h
#include "SDL_stdinc.h"
#include "SDL_video.h"
#include "SDL_shape.h"
#include "SDL_shape_internals.h"
#include "../SDL_sysvideo.h"
typedef
struct
{
NSGraphicsContext
*
context
;
SDL_
B
ool
saved
;
SDL_
b
ool
saved
;
NSRect
*
rects
;
Uint32
count
;
SDL_ShapeTree
*
shape
;
}
SDL_ShapeData
;
extern
SDL_WindowShaper
*
Cocoa_CreateShaper
(
SDL_Window
*
window
);
extern
int
Cocoa_SetWindowShape
(
SDL_WindowShaper
*
shaper
,
SDL_Surface
*
shape
,
SDL_WindowShapeMode
*
shapeMode
);
extern
int
Cocoa_ResizeWindowShape
(
SDL_Window
*
window
);
#endif
src/video/cocoa/SDL_cocoashape.m
View file @
8f1459d9
...
...
@@ -20,28 +20,29 @@
eligottlieb
@
gmail
.
com
*/
#include
"SDL_stdinc.h"
#include
"SDL_cocoavideo.h"
#include
"SDL_shape.h"
#include
"SDL_cocoashape.h"
#include
"SDL_sysvideo.h"
SDL
_
WindowShaper
*
Cocoa
_
CreateShaper
(
SDL
_
Window
*
window
)
{
SDL
_
WindowData
*
data
=
(
SDL
_
WindowData
*
)
window
->
driverdata
;
[
data
->
nswindow
setAlpha
:
1.0
]
;
[
data
->
nswindow
setOpaque
:
YES
]
;
[
data
->
nswindow
setStyleMask
:
NSBorderlessWindowMask
]
;
SDL
_
Shaper
*
result
=
result
=
malloc
(
sizeof
(
SDL
_
WindowShaper
))
;
SDL
_
WindowShaper
*
result
=
SDL
_
malloc
(
sizeof
(
SDL
_
WindowShaper
))
;
result
->
window
=
window
;
result
->
mode
.
mode
=
ShapeModeDefault
;
result
->
mode
.
parameters
.
binarizationCutoff
=
1
;
result
->
usershownflag
=
0
;
window
->
shaper
=
result
;
SDL
_
ShapeData
*
data
=
malloc
(
sizeof
(
SDL
_
ShapeData
))
;
result
->
driverdata
=
data
;
data
->
context
=
[
data
->
nswindow
graphicsContext
]
;
data
->
saved
=
SDL
_
False
;
data
->
rects
=
NULL
;
data
->
count
=
0
;
SDL
_
ShapeData
*
shape
_
data
=
SDL
_
malloc
(
sizeof
(
SDL
_
ShapeData
))
;
result
->
driverdata
=
shape
_
data
;
shape
_
data
->
context
=
[
data
->
nswindow
graphicsContext
]
;
shape
_
data
->
saved
=
SDL
_
FALSE
;
shape
_
data
->
shape
=
NULL
;
int
resized
_
properly
=
Cocoa
_
ResizeWindowShape
(
window
)
;
assert
(
resized
_
properly
==
0
)
;
...
...
@@ -49,17 +50,17 @@ SDL_WindowShaper* Cocoa_CreateShaper(SDL_Window* window) {
}
int
Cocoa
_
SetWindowShape
(
SDL
_
WindowShaper
*
shaper
,
SDL
_
Surface
*
shape
,
SDL
_
WindowShapeMode
*
shapeMode
)
{
SDL
_
WindowData
*
data
=
(
SDL
_
WindowData
*
)
shaper
->
window
->
driverdata
;
if
(
data
->
saved
==
SDL
_
T
rue
)
{
SDL
_
ShapeData
*
data
=
(
SDL
_
ShapeData
*
)
shaper
->
driverdata
;
if
(
data
->
saved
==
SDL
_
T
RUE
)
{
[
data
->
context
restoreGraphicsState
]
;
data
->
saved
=
SDL
_
F
alse
;
data
->
saved
=
SDL
_
F
ALSE
;
}
[
data
->
context
saveGraphicsState
]
;
data
->
saved
=
SDL
_
T
rue
;
data
->
saved
=
SDL
_
T
RUE
;
[[
NSColor
clearColor
]
set
]
;
NSRectFill
([[
data
->
nswindow
contentView
]
frame
])
;
NSRectFill
([[
((
SDL
_
WindowData
*
)
shaper
->
window
->
driverdata
)
->
nswindow
contentView
]
frame
])
;
/*
TODO
:
It
looks
like
Cocoa
can
set
a
clipping
path
based
on
a
list
of
rectangles
.
That
'
s
what
we
get
from
the
Windoze
shape
-
calculation
code
:
a
list
of
rectangles
.
This
will
work
...
I
think
.
*/
}
...
...
@@ -67,5 +68,9 @@ int Cocoa_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowS
int
Cocoa
_
ResizeWindowShape
(
SDL
_
Window
*
window
)
{
SDL
_
ShapeData
*
data
=
window
->
shaper
->
driverdata
;
assert
(
data
!=
NULL
)
;
if
(
data
->
shape
!=
NULL
)
SDL
_
FreeShapeTree
(
&
data
->
shape
)
;
return
0
;
}
src/video/cocoa/SDL_cocoavideo.m
View file @
8f1459d9
...
...
@@ -22,6 +22,7 @@
#include "SDL_config.h"
#include "SDL_cocoavideo.h"
#include "SDL_cocoashape.h"
#include "SDL_assert.h"
/* Initialization/Query functions */
...
...
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