-
Notifications
You must be signed in to change notification settings - Fork 3
/
FrameBuffer.h
89 lines (73 loc) · 1.93 KB
/
FrameBuffer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/**********************************************
* *
* AGE v 0.4 *
* Amiga Game Engine *
* Copyright 2011-2018 *
* by Pedro Gil Guirado - Balrog Soft *
* www.amigaskool.net *
* *
**********************************************/
#ifndef _FRAMEBUFFER_H
#define _FRAMEBUFFER_H
#include <graphics/rastport.h>
#include <intuition/screens.h>
#include <intuition/intuition.h>
#include <graphics/gfxbase.h>
#include <exec/execbase.h>
#include <proto/graphics.h>
#include <proto/intuition.h>
#include "Bitmap.h"
#define DB_SCROLLVPORT 1
#define FB_SCROLL 2
#define FB_NOCURSOR 4
#define FB_EHBMODE 8
#define FB_SYS36 16
#define FB_SYS38 32
typedef struct {
int width;
int height;
int screenWidth;
int screenHeight;
int depth;
int frame;
USHORT *colortable;
USHORT colors;
int scrollX[2];
int scrollY[2];
BOOL isCGFX;
BOOL isAGA;
BOOL isMorphOS;
int frameOffset;
int oscanHeight;
int flags;
/* Internal variables */
/* SysBase >= 38 */
struct ScreenBuffer *hardwareScreenBuffer[2];
struct BitMap *tempbm[2];
struct RastPort rport[ 2 ];
struct RastPort temprp[2];
UBYTE *tmpbuf[2];
struct MsgPort *dispPort;
struct MsgPort *safePort;
struct TmpRas tmpras[2];
BOOL safeToWrite;
BOOL safeToChange;
/* MorphOS */
struct BitMap *bitmapBuffer[2];
struct RastPort rportbm[2];
/* Common */
LONG sysVersion;
struct Screen *screen;
struct Window *window;
struct RastPort *rastPort;
struct RasInfo *rastInfo;
struct BitMap *tmpBM;
struct RastPort tmpRP;
} FrameBuffer;
FrameBuffer* fb_initExtended(int width, int height, int screenWidth, int screenHeight, int depth, int flags);
FrameBuffer* fb_init(int width, int height, int depth, int flags);
void fb_dealloc(FrameBuffer* fb);
void fb_flush(FrameBuffer* fb, BOOL sync);
void fb_setPalette(FrameBuffer* fb, Bitmap *bm);
void fb_loadPalette(FrameBuffer* fb, char* file);
#endif