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
06dfd29b
Commit
06dfd29b
authored
Aug 08, 2011
by
Nathan Heisey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some video fixes
parent
3c7c7216
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
27 deletions
+68
-27
SDL_BWin.h
src/video/bwindow/SDL_BWin.h
+10
-1
SDL_bframebuffer.cc
src/video/bwindow/SDL_bframebuffer.cc
+12
-1
SDL_bopengl.cc
src/video/bwindow/SDL_bopengl.cc
+46
-25
No files found.
src/video/bwindow/SDL_BWin.h
View file @
06dfd29b
...
...
@@ -156,7 +156,8 @@ class SDL_BWin:public BDirectWindow
/* Determine if the pixel buffer is usable after this update */
_trash_window_buffer
=
_trash_window_buffer
||
((
info
->
buffer_state
&
B_BUFFER_RESIZED
)
||
(
info
->
buffer_state
&
B_BUFFER_RESET
));
||
(
info
->
buffer_state
&
B_BUFFER_RESET
)
||
(
info
->
driver_state
==
B_MODE_CHANGED
));
LockBuffer
();
switch
(
info
->
buffer_state
&
B_DIRECT_MODE_MASK
)
{
...
...
@@ -193,7 +194,12 @@ class SDL_BWin:public BDirectWindow
}
#endif
/* Call the base object directconnected */
BDirectWindow
::
DirectConnected
(
info
);
UnlockBuffer
();
}
...
...
@@ -407,6 +413,9 @@ class SDL_BWin:public BDirectWindow
bool
BufferExists
()
{
return
_buffer_created
;
}
bool
BufferIsDirty
()
{
return
_buffer_dirty
;
}
BBitmap
*
GetBitmap
()
{
return
_bitmap
;
}
#if SDL_VIDEO_OPENGL
BGLView
*
GetGLView
()
{
return
_SDL_GLView
;
}
#endif
/* Setter methods */
void
SetID
(
int32
id
)
{
_id
=
id
;
}
...
...
src/video/bwindow/SDL_bframebuffer.cc
View file @
06dfd29b
...
...
@@ -62,12 +62,20 @@ int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window,
/* Create the new bitmap object */
BBitmap
*
bitmap
=
bwin
->
GetBitmap
();
if
(
bitmap
)
{
delete
bitmap
;
}
bitmap
=
new
BBitmap
(
bwin
->
Bounds
(),
(
color_space
)
bmode
.
space
,
false
,
/* Views not accepted */
true
);
/* Contiguous memory required */
if
(
bitmap
->
InitCheck
()
!=
B_OK
)
{
SDL_SetError
(
"Could not initialize back buffer!
\n
"
);
return
-
1
;
}
bwin
->
SetBitmap
(
bitmap
);
/* Set the pixel pointer */
...
...
@@ -132,7 +140,7 @@ int32 BE_DrawThread(void *data) {
int32
height
=
clips
[
i
].
bottom
-
clips
[
i
].
top
+
1
;
bufferpx
=
bwin
->
GetBufferPx
()
+
clips
[
i
].
top
*
bufferPitch
+
clips
[
i
].
left
*
BPP
;
windowpx
=
(
uint8
*
)
bitmap
->
Bits
()
;
+
windowpx
=
(
uint8
*
)
bitmap
->
Bits
()
+
clips
[
i
].
top
*
windowPitch
+
clips
[
i
].
left
*
BPP
-
windowSub
;
...
...
@@ -143,11 +151,14 @@ int32 BE_DrawThread(void *data) {
if
(
bwin
->
CanTrashWindowBuffer
())
{
goto
escape
;
/* Break out before the buffer is killed */
}
// printf("memcpy(0x%x, 0x%x, %i) ", bufferpx, windowpx, width * BPP);
memcpy
(
bufferpx
,
windowpx
,
width
*
BPP
);
bufferpx
+=
bufferPitch
;
windowpx
+=
windowPitch
;
}
// printf("\t-\t");
}
// printf("\n");
bwin
->
SetBufferDirty
(
false
);
escape
:
bwin
->
UnlockBuffer
();
...
...
src/video/bwindow/SDL_bopengl.cc
View file @
06dfd29b
...
...
@@ -119,6 +119,52 @@ void *BE_GL_GetProcAddress(_THIS, const char *proc)
}
void
BE_GL_SwapWindow
(
_THIS
,
SDL_Window
*
window
)
{
_ToBeWin
(
window
)
->
SwapBuffers
();
}
int
BE_GL_MakeCurrent
(
_THIS
,
SDL_Window
*
window
,
SDL_GLContext
context
)
{
_GetBeApp
()
->
SetCurrentContext
(((
SDL_BWin
*
)
context
)
->
GetGLView
());
return
0
;
}
SDL_GLContext
BE_GL_CreateContext
(
_THIS
,
SDL_Window
*
window
)
{
/* FIXME: Not sure what flags should be included here; may want to have
most of them */
SDL_BWin
*
bwin
=
_ToBeWin
(
window
);
bwin
->
CreateGLView
(
BGL_RGB
|
BGL_DOUBLE
);
return
(
SDL_GLContext
)(
bwin
);
}
void
BE_GL_DeleteContext
(
_THIS
,
SDL_GLContext
context
)
{
/* Currently, automatically unlocks the view */
((
SDL_BWin
*
)
context
)
->
RemoveGLView
();
}
int
BE_GL_SetSwapInterval
(
_THIS
,
int
interval
)
{
printf
(
__FILE__
": %d- swap interval set
\n
"
,
__LINE__
);
return
0
;
}
int
BE_GL_GetSwapInterval
(
_THIS
)
{
printf
(
__FILE__
": %d- swap interval requested
\n
"
,
__LINE__
);
return
0
;
}
void
BE_GL_UnloadLibrary
(
_THIS
)
{
printf
(
__FILE__
": %d- Library unloaded
\n
"
,
__LINE__
);
}
#if 0 /* Functions from 1.2 that do not appear to be used in 1.3 */
int BE_GL_GetAttribute(_THIS, SDL_GLattr attrib, int *value)
...
...
@@ -182,38 +228,13 @@ void *BE_GL_GetProcAddress(_THIS, const char *proc)
}
#endif
void
BE_GL_SwapWindow
(
_THIS
,
SDL_Window
*
window
)
{
_ToBeWin
(
window
)
->
SwapBuffers
();
}
int
BE_GL_MakeCurrent
(
_THIS
,
SDL_Window
*
window
,
SDL_GLContext
context
)
{
_GetBeApp
()
->
SetCurrentContext
((
BGLView
*
)
context
);
return
0
;
}
SDL_GLContext
BE_GL_CreateContext
(
_THIS
,
SDL_Window
*
window
)
{
/* FIXME: Not sure what flags should be included here; may want to have
most of them */
return
(
SDL_GLContext
)(
_ToBeWin
(
window
)
->
CreateGLView
(
BGL_RGB
|
BGL_DOUBLE
));
}
void
BE_GL_DeleteContext
(
_THIS
,
SDL_GLContext
context
)
{
/* Currently, automatically unlocks the view */
// _ToBeWin(window)->RemoveGLView(); FIXME: Need to get the bwindow somehow
}
int
BE_GL_SetSwapInterval
(
_THIS
,
int
interval
)
{
}
int
BE_GL_GetSwapInterval
(
_THIS
)
{
}
void
BE_GL_UnloadLibrary
(
_THIS
)
{
}
#ifdef __cplusplus
}
...
...
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