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
20af8e06
Commit
20af8e06
authored
Jul 25, 2011
by
Nathan Heisey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Variable name/debugging output changes
parent
96dd15dd
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
114 deletions
+99
-114
SDL_BWin.h
src/video/bwindow/SDL_BWin.h
+87
-94
SDL_bmodes.cc
src/video/bwindow/SDL_bmodes.cc
+8
-16
SDL_bwindow.cc
src/video/bwindow/SDL_bwindow.cc
+4
-4
No files found.
src/video/bwindow/SDL_BWin.h
View file @
20af8e06
This diff is collapsed.
Click to expand it.
src/video/bwindow/SDL_bmodes.cc
View file @
20af8e06
...
...
@@ -118,20 +118,19 @@ static inline void BE_BDisplayModeToSdlDisplayMode(display_mode *bmode,
/* Later, there may be more than one monitor available */
void
BE_AddDisplay
(
BScreen
*
screen
)
{
SDL_VideoDisplay
display
;
SDL_DisplayMode
mode
;
SDL_DisplayMode
*
mode
=
(
SDL_DisplayMode
*
)
SDL_calloc
(
1
,
sizeof
(
SDL_DisplayMode
))
;
display_mode
bmode
;
screen
->
GetMode
(
&
bmode
);
BE_BDisplayModeToSdlDisplayMode
(
&
bmode
,
&
mode
);
BE_BDisplayModeToSdlDisplayMode
(
&
bmode
,
mode
);
SDL_zero
(
display
);
display
.
desktop_mode
=
mode
;
display
.
current_mode
=
mode
;
display
.
desktop_mode
=
*
mode
;
display
.
current_mode
=
*
mode
;
SDL_AddVideoDisplay
(
&
display
);
}
int
BE_InitModes
(
_THIS
)
{
printf
(
"Init Modes
\n
"
);
BScreen
screen
;
/* Save the current display mode */
...
...
@@ -144,6 +143,7 @@ int BE_InitModes(_THIS) {
}
int
BE_QuitModes
(
_THIS
)
{
printf
(
__FILE__
": %d; Begin quit
\n
"
,
__LINE__
);
/* Restore the previous video mode */
BScreen
screen
;
display_mode
*
savedMode
=
_GetBeApp
()
->
GetPrevMode
();
...
...
@@ -163,10 +163,9 @@ int BE_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) {
}
void
BE_GetDisplayModes
(
_THIS
,
SDL_VideoDisplay
*
display
)
{
printf
(
"Get Display Modes
\n
"
);
/* Get the current screen */
BScreen
bscreen
;
/* Iterate through all of the modes */
SDL_DisplayMode
mode
;
display_mode
this_bmode
;
...
...
@@ -188,7 +187,6 @@ void BE_GetDisplayModes(_THIS, SDL_VideoDisplay *display) {
}
int
BE_SetDisplayMode
(
_THIS
,
SDL_VideoDisplay
*
display
,
SDL_DisplayMode
*
mode
){
printf
(
"Set Display Modes
\n
"
);
/* Get the current screen */
BScreen
bscreen
;
...
...
@@ -212,7 +210,7 @@ int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window,
return
-
1
;
}
while
(
!
bwin
->
Connected
())
{
snooze
(
1
60
0
);
}
while
(
!
bwin
->
Connected
())
{
snooze
(
10
);
}
/* Make sure we have exclusive access to frame buffer data */
bwin
->
LockBuffer
();
...
...
@@ -228,7 +226,6 @@ int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window,
/* Create a copy of the pixel buffer if it doesn't recycle */
*
pixels
=
bwin
->
GetWindowFramebuffer
();
printf
(
__FILE__
": %d; window frame buffer make
\n
"
,
__LINE__
);
if
(
bwin
->
CanTrashWindowBuffer
()
||
(
*
pixels
)
==
NULL
)
{
if
(
(
*
pixels
)
!=
NULL
)
{
SDL_free
(
*
pixels
);
...
...
@@ -236,11 +233,6 @@ int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window,
*
pixels
=
SDL_calloc
((
*
pitch
)
*
bwin
->
GetFbHeight
()
*
bwin
->
GetBytesPerPx
(),
sizeof
(
uint8
));
bwin
->
SetWindowFramebuffer
((
uint8
*
)(
*
pixels
));
if
(
*
pixels
)
{
printf
(
__FILE__
": %d; Success!
\n
"
,
__LINE__
);
}
else
{
printf
(
__FILE__
": %d; FAIL!
\n
"
,
__LINE__
);
}
}
bwin
->
UnlockBuffer
();
...
...
@@ -283,7 +275,7 @@ int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
clips
[
i
].
top
*
bufferPitch
+
clips
[
i
].
left
*
BPP
;
windowpx
=
windowBaseAddress
+
clips
[
i
].
top
*
windowPitch
+
clips
[
i
].
left
*
BPP
-
windowSub
;
printf
(
__FILE__
": %d
\n\t
windowpx = 0x%x
\n\t
bufferpx = 0x%x
\n\t
windowPitch = %i
\n\t
bufferPitch = %i
\n
"
,
__LINE__
,
windowpx
,
bufferpx
,
windowPitch
,
bufferPitch
);
/* Copy each row of pixels from the window buffer into the frame
buffer */
for
(
y
=
0
;
y
<
height
;
++
y
)
...
...
src/video/bwindow/SDL_bwindow.cc
View file @
20af8e06
...
...
@@ -37,25 +37,25 @@ static inline SDL_BApp *_GetBeApp() {
return
((
SDL_BApp
*
)
be_app
);
}
int
_InitWindow
(
_THIS
,
SDL_Window
*
window
)
{
printf
(
"SDL_bwindow.cc: 40
\n
"
);
int
_InitWindow
(
_THIS
,
SDL_Window
*
window
)
{
BRect
bounds
(
window
->
x
,
window
->
y
,
window
->
x
+
window
->
w
-
1
,
//BeWindows have an off-by-one px w/h thing
window
->
y
+
window
->
h
-
1
);
printf
(
"SDL_bwindow.cc: 30
\n
"
);
SDL_BWin
*
bwin
=
new
(
std
::
nothrow
)
SDL_BWin
(
bounds
);
if
(
bwin
==
NULL
)
return
ENOMEM
;
printf
(
"SDL_bwindow.cc: 51
\n
"
);
window
->
driverdata
=
bwin
;
int32
winID
=
_GetBeApp
()
->
GetID
(
window
);
bwin
->
SetID
(
winID
);
return
0
;
}
int
BE_CreateWindow
(
_THIS
,
SDL_Window
*
window
)
{
printf
(
"SDL_bwindow.cc: 58
\n
"
);
int
BE_CreateWindow
(
_THIS
,
SDL_Window
*
window
)
{
if
(
_InitWindow
(
_this
,
window
)
==
ENOMEM
)
return
ENOMEM
;
...
...
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