Go to the documentation of this file.
21 #include "../../SDL_internal.h"
23 #if SDL_VIDEO_DRIVER_HAIKU
28 #include <InterfaceKit.h>
32 #include "../../main/haiku/SDL_BApp.h"
52 void **
pixels,
int *pitch) {
55 if(!bscreen.IsValid()) {
59 while(!bwin->
Connected()) { snooze(100); }
66 bscreen.GetMode(&bmode);
76 bitmap =
new BBitmap(bwin->Bounds(), (color_space)bmode.space,
80 if(
bitmap->InitCheck() != B_OK) {
82 return SDL_SetError(
"Could not initialize back buffer!");
92 *pitch =
bitmap->BytesPerRow();
125 if(!bscreen.IsValid()) {
134 int32 windowPitch =
bitmap->BytesPerRow();
141 bwin->
GetFbY() * windowPitch;
142 clipping_rect *clips = bwin->
GetClips();
147 bscreen.WaitForRetrace();
148 for(
i = 0;
i < numClips; ++
i) {
150 int32
width = clips[
i].right - clips[
i].left + 1;
151 int32
height = clips[
i].bottom - clips[
i].top + 1;
153 clips[
i].top * bufferPitch + clips[
i].left *
BPP;
154 windowpx = (uint8*)
bitmap->Bits() +
155 clips[
i].top * windowPitch + clips[
i].left *
BPP -
168 bufferpx += bufferPitch;
169 windowpx += windowPitch;
208 if(!bscreen.IsValid()) {
214 int32 windowPitch =
window->surface->pitch;
220 uint8 *windowBaseAddress = (uint8*)
window->surface->pixels;
222 bwin->
GetFbY() * windowPitch;
223 clipping_rect *clips = bwin->
GetClips();
228 bscreen.WaitForRetrace();
229 for(
i = 0;
i < numClips; ++
i) {
231 int32
width = clips[
i].right - clips[
i].left + 1;
232 int32
height = clips[
i].bottom - clips[
i].top + 1;
234 clips[
i].top * bufferPitch + clips[
i].left *
BPP;
235 windowpx = windowBaseAddress +
236 clips[
i].top * windowPitch + clips[
i].left *
BPP - windowSub;
243 bufferpx += bufferPitch;
244 windowpx += windowPitch;
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
GLint GLint GLsizei width
bool CanTrashWindowBuffer()
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
The type used to identify a window.
EGLSurface EGLNativeWindowType * window
void SetBitmap(BBitmap *bitmap)
GLint GLint GLsizei GLsizei height
int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
int HAIKU_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects)
int32 HAIKU_DrawThread(void *data)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
void SetBufferExists(bool bufferExists)
GLint GLint GLint GLint GLint GLint y
GLsizei GLfixed GLfixed GLfixed GLfixed const GLubyte * bitmap
int32 HAIKU_ColorSpaceToBitsPerPixel(uint32 colorspace)
A rectangle, with the origin at the upper left (integer).
void SetBufferDirty(bool bufferDirty)
int32 HAIKU_BPPToSDLPxFormat(int32 bpp)
EGLSurface EGLint * rects
void SetTrashBuffer(bool trash)
clipping_rect * GetClips()
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
void HAIKU_DestroyWindowFramebuffer(_THIS, SDL_Window *window)