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
7121f4e5
Commit
7121f4e5
authored
Jul 26, 2011
by
Nathan Heisey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed seg fault on video quit
parent
20af8e06
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
8 deletions
+16
-8
SDL_bmodes.cc
src/video/bwindow/SDL_bmodes.cc
+11
-3
SDL_bvideo.cc
src/video/bwindow/SDL_bvideo.cc
+4
-2
SDL_bvideo.h
src/video/bwindow/SDL_bvideo.h
+0
-3
SDL_bwindow.h
src/video/bwindow/SDL_bwindow.h
+1
-0
No files found.
src/video/bwindow/SDL_bmodes.cc
View file @
7121f4e5
...
...
@@ -32,6 +32,13 @@
extern
"C"
{
#endif
/* This wrapper is here so that the driverdata can be freed */
typedef
struct
SDL_DisplayModeData
{
display_mode
*
bmode
;
};
static
inline
SDL_BWin
*
_ToBeWin
(
SDL_Window
*
window
)
{
return
((
SDL_BWin
*
)(
window
->
driverdata
));
}
...
...
@@ -107,8 +114,9 @@ static inline void BE_BDisplayModeToSdlDisplayMode(display_mode *bmode,
mode
->
w
=
bmode
->
virtual_width
;
mode
->
h
=
bmode
->
virtual_height
;
mode
->
refresh_rate
=
(
int
)
get_refresh_rate
(
*
bmode
);
mode
->
driverdata
=
bmode
;
/* This makes setting display
modes easier */
SDL_DisplayModeData
*
data
=
(
SDL_DisplayModeData
*
)
SDL_calloc
(
1
,
sizeof
(
SDL_DisplayModeData
));
data
->
bmode
=
bmode
;
mode
->
driverdata
=
data
;
/* Set the format */
int32
bpp
=
ColorSpaceToBitsPerPixel
(
bmode
->
space
);
...
...
@@ -191,7 +199,7 @@ int BE_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode){
BScreen
bscreen
;
/* Set the mode using the driver data */
display_mode
*
bmode
=
(
display_mode
*
)
mode
->
driverdata
;
display_mode
*
bmode
=
(
(
SDL_DisplayModeData
*
)
mode
->
driverdata
)
->
bmode
;
if
(
bscreen
.
SetMode
(
bmode
)
==
B_OK
)
{
return
0
;
/* No error */
}
...
...
src/video/bwindow/SDL_bvideo.cc
View file @
7121f4e5
...
...
@@ -59,10 +59,11 @@ static SDL_VideoDevice *
BE_CreateDevice
(
int
devindex
)
{
SDL_VideoDevice
*
device
;
SDL_VideoData
*
data
;
/*SDL_VideoData *data;*/
/* Initialize all variables that we clean on shutdown */
device
=
(
SDL_VideoDevice
*
)
SDL_calloc
(
1
,
sizeof
(
SDL_VideoDevice
));
#if 0
if (device) {
data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
} else {
...
...
@@ -75,7 +76,8 @@ BE_CreateDevice(int devindex)
}
return NULL;
}
device
->
driverdata
=
data
;
#endif
device
->
driverdata
=
NULL
;
/*data;*/
/* TODO: Figure out what sort of initialization needs to go here */
...
...
src/video/bwindow/SDL_bvideo.h
View file @
7121f4e5
...
...
@@ -29,9 +29,6 @@ extern "C" {
#include "../../main/beos/SDL_BeApp.h"
#include "../SDL_sysvideo.h"
typedef
struct
SDL_VideoData
{
}
SDL_VideoData
;
extern
void
BE_VideoQuit
(
_THIS
);
extern
int
BE_VideoInit
(
_THIS
);
...
...
src/video/bwindow/SDL_bwindow.h
View file @
7121f4e5
...
...
@@ -25,6 +25,7 @@
#include "../SDL_sysvideo.h"
extern
int
BE_CreateWindow
(
_THIS
,
SDL_Window
*
window
);
extern
int
BE_CreateWindowFrom
(
_THIS
,
SDL_Window
*
window
,
const
void
*
data
);
extern
void
BE_SetWindowTitle
(
_THIS
,
SDL_Window
*
window
);
...
...
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