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
96dd15dd
Commit
96dd15dd
authored
Jul 25, 2011
by
Nathan Heisey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrected framebuffer creation problem
parent
ee8ee9d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
SDL_bmodes.cc
src/video/bwindow/SDL_bmodes.cc
+9
-2
No files found.
src/video/bwindow/SDL_bmodes.cc
View file @
96dd15dd
...
...
@@ -228,13 +228,19 @@ int BE_CreateWindowFramebuffer(_THIS, SDL_Window * window,
/* Create a copy of the pixel buffer if it doesn't recycle */
*
pixels
=
bwin
->
GetWindowFramebuffer
();
if
(
bwin
->
CanTrashWindowBuffer
()
)
{
printf
(
__FILE__
": %d; window frame buffer make
\n
"
,
__LINE__
);
if
(
bwin
->
CanTrashWindowBuffer
()
||
(
*
pixels
)
==
NULL
)
{
if
(
(
*
pixels
)
!=
NULL
)
{
SDL_free
(
*
pixels
);
}
*
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
();
...
...
@@ -269,6 +275,7 @@ int BE_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
/* Blit each clipping rectangle */
bscreen
.
WaitForRetrace
();
for
(
i
=
0
;
i
<
numClips
;
++
i
)
{
clipping_rect
rc
=
clips
[
i
];
/* Get addresses of the start of each clipping rectangle */
int32
width
=
clips
[
i
].
right
-
clips
[
i
].
left
+
1
;
int32
height
=
clips
[
i
].
bottom
-
clips
[
i
].
top
+
1
;
...
...
@@ -276,7 +283,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
)
...
...
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