23 #if SDL_VIDEO_DRIVER_BWINDOW
28 #include <InterfaceKit.h>
32 #include "../../main/beos/SDL_BApp.h"
44 static inline SDL_BApp *_GetBeApp() {
50 void **
pixels,
int *pitch) {
53 if(!bscreen.IsValid()) {
57 while(!bwin->
Connected()) { snooze(100); }
64 bscreen.GetMode(&bmode);
74 bitmap =
new BBitmap(bwin->Bounds(), (color_space)bmode.space,
78 if(bitmap->InitCheck() != B_OK) {
79 return SDL_SetError(
"Could not initialize back buffer!\n");
86 *pixels = bitmap->Bits();
89 *pitch = bitmap->BytesPerRow();
100 const SDL_Rect * rects,
int numrects) {
112 BE_UpdateOnce(window);
122 if(!bscreen.IsValid()) {
129 BBitmap *bitmap =
NULL;
131 int32 windowPitch = bitmap->BytesPerRow();
137 int32 windowSub = bwin->
GetFbX() * BPP +
138 bwin->
GetFbY() * windowPitch;
139 clipping_rect *clips = bwin->
GetClips();
144 bscreen.WaitForRetrace();
145 for(i = 0; i < numClips; ++
i) {
146 clipping_rect rc = clips[
i];
148 int32
width = clips[
i].right - clips[
i].left + 1;
149 int32
height = clips[
i].bottom - clips[
i].top + 1;
151 clips[
i].top * bufferPitch + clips[
i].left * BPP;
152 windowpx = (uint8*)bitmap->Bits() +
153 clips[
i].top * windowPitch + clips[
i].left * BPP -
165 memcpy(bufferpx, windowpx, width * BPP);
166 bufferpx += bufferPitch;
167 windowpx += windowPitch;
205 if(!bscreen.IsValid()) {
218 int32 windowSub = bwin->
GetFbX() * BPP +
219 bwin->
GetFbY() * windowPitch;
220 clipping_rect *clips = bwin->
GetClips();
225 bscreen.WaitForRetrace();
226 for(i = 0; i < numClips; ++
i) {
227 clipping_rect rc = clips[
i];
229 int32 width = clips[
i].right - clips[
i].left + 1;
230 int32 height = clips[
i].bottom - clips[
i].top + 1;
232 clips[
i].top * bufferPitch + clips[
i].left * BPP;
233 windowpx = windowBaseAddress +
234 clips[
i].top * windowPitch + clips[
i].left * BPP - windowSub;
240 memcpy(bufferpx, windowpx, width * BPP);
241 bufferpx += bufferPitch;
242 windowpx += windowPitch;
int32 BE_ColorSpaceToBitsPerPixel(uint32 colorspace)
EGLSurface EGLint EGLint EGLint EGLint height
clipping_rect * GetClips()
void SetBitmap(BBitmap *bitmap)
void SetBufferExists(bool bufferExists)
uint32_t Uint32
An unsigned 32-bit integer type.
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
EGLSurface EGLint EGLint EGLint width
int32 BE_BPPToSDLPxFormat(int32 bpp)
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum format
DECLSPEC int SDLCALL SDL_SetError(const char *fmt,...)
void SetBufferDirty(bool bufferDirty)
int BE_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects)
EGLSurface EGLint EGLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
int BE_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
void BE_DestroyWindowFramebuffer(_THIS, SDL_Window *window)
bool CanTrashWindowBuffer()
GLsizei GLfixed GLfixed GLfixed GLfixed const GLubyte * bitmap
void SetTrashBuffer(bool trash)
int32 BE_DrawThread(void *data)
A rectangle, with the origin at the upper left.