Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
executable file
·
173 lines (136 loc) · 5.03 KB

SDL_bvideo.cc

File metadata and controls

executable file
·
173 lines (136 loc) · 5.03 KB
 
1
2
/*
Simple DirectMedia Layer
Dec 31, 2011
Dec 31, 2011
3
Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
Oct 31, 2011
Oct 31, 2011
21
#include "SDL_config.h"
Oct 31, 2011
Oct 31, 2011
23
#if SDL_VIDEO_DRIVER_BWINDOW
Jul 20, 2011
Jul 20, 2011
24
25
26
27
28
29
#ifdef __cplusplus
extern "C" {
#endif
Jul 26, 2011
Jul 26, 2011
30
#include "SDL_bkeyboard.h"
31
32
33
34
35
#include "SDL_bwindow.h"
#include "SDL_bclipboard.h"
#include "SDL_bvideo.h"
#include "SDL_bopengl.h"
#include "SDL_bmodes.h"
Jul 30, 2011
Jul 30, 2011
36
#include "SDL_bframebuffer.h"
Jul 20, 2011
Jul 20, 2011
37
#include "SDL_bevents.h"
38
39
/* FIXME: Undefined functions */
Jul 20, 2011
Jul 20, 2011
40
// #define BE_PumpEvents NULL
41
42
43
44
45
46
47
48
49
50
51
52
#define BE_StartTextInput NULL
#define BE_StopTextInput NULL
#define BE_SetTextInputRect NULL
// #define BE_DeleteDevice NULL
/* End undefined functions */
static SDL_VideoDevice *
BE_CreateDevice(int devindex)
{
SDL_VideoDevice *device;
Jul 26, 2011
Jul 26, 2011
53
/*SDL_VideoData *data;*/
54
55
56
57
/* Initialize all variables that we clean on shutdown */
device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
Aug 22, 2011
Aug 22, 2011
58
59
60
61
device->driverdata = NULL; /* FIXME: Is this the cause of some of the
SDL_Quit() errors? */
/* TODO: Figure out if any initialization needs to go here */
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
90
91
92
93
94
95
/* Set the function pointers */
device->VideoInit = BE_VideoInit;
device->VideoQuit = BE_VideoQuit;
device->GetDisplayBounds = BE_GetDisplayBounds;
device->GetDisplayModes = BE_GetDisplayModes;
device->SetDisplayMode = BE_SetDisplayMode;
device->PumpEvents = BE_PumpEvents;
device->CreateWindow = BE_CreateWindow;
device->CreateWindowFrom = BE_CreateWindowFrom;
device->SetWindowTitle = BE_SetWindowTitle;
device->SetWindowIcon = BE_SetWindowIcon;
device->SetWindowPosition = BE_SetWindowPosition;
device->SetWindowSize = BE_SetWindowSize;
device->ShowWindow = BE_ShowWindow;
device->HideWindow = BE_HideWindow;
device->RaiseWindow = BE_RaiseWindow;
device->MaximizeWindow = BE_MaximizeWindow;
device->MinimizeWindow = BE_MinimizeWindow;
device->RestoreWindow = BE_RestoreWindow;
device->SetWindowFullscreen = BE_SetWindowFullscreen;
device->SetWindowGammaRamp = BE_SetWindowGammaRamp;
device->GetWindowGammaRamp = BE_GetWindowGammaRamp;
device->SetWindowGrab = BE_SetWindowGrab;
device->DestroyWindow = BE_DestroyWindow;
device->GetWindowWMInfo = BE_GetWindowWMInfo;
device->CreateWindowFramebuffer = BE_CreateWindowFramebuffer;
device->UpdateWindowFramebuffer = BE_UpdateWindowFramebuffer;
device->DestroyWindowFramebuffer = BE_DestroyWindowFramebuffer;
device->shape_driver.CreateShaper = NULL;
device->shape_driver.SetWindowShape = NULL;
device->shape_driver.ResizeWindowShape = NULL;
Jul 30, 2011
Jul 30, 2011
96
Aug 22, 2011
Aug 22, 2011
97
98
99
100
101
102
103
104
105
106
device->GL_LoadLibrary = BE_GL_LoadLibrary;
device->GL_GetProcAddress = BE_GL_GetProcAddress;
device->GL_UnloadLibrary = BE_GL_UnloadLibrary;
device->GL_CreateContext = BE_GL_CreateContext;
device->GL_MakeCurrent = BE_GL_MakeCurrent;
device->GL_SetSwapInterval = BE_GL_SetSwapInterval;
device->GL_GetSwapInterval = BE_GL_GetSwapInterval;
device->GL_SwapWindow = BE_GL_SwapWindow;
device->GL_DeleteContext = BE_GL_DeleteContext;
Aug 22, 2011
Aug 22, 2011
107
108
109
110
111
112
113
114
115
116
117
118
119
120
device->StartTextInput = BE_StartTextInput;
device->StopTextInput = BE_StopTextInput;
device->SetTextInputRect = BE_SetTextInputRect;
device->SetClipboardText = BE_SetClipboardText;
device->GetClipboardText = BE_GetClipboardText;
device->HasClipboardText = BE_HasClipboardText;
device->free = BE_DeleteDevice;
return device;
}
Jul 20, 2011
Jul 20, 2011
121
122
123
124
125
VideoBootStrap BWINDOW_bootstrap = {
"bwindow", "BDirectWindow graphics",
BE_Available, BE_CreateDevice
};
Aug 22, 2011
Aug 22, 2011
126
void BE_DeleteDevice(SDL_VideoDevice * device)
127
128
129
130
131
132
133
134
135
136
137
138
{
SDL_free(device->driverdata);
SDL_free(device);
}
int BE_VideoInit(_THIS)
{
/* Initialize the Be Application for appserver interaction */
if (SDL_InitBeApp() < 0) {
return -1;
}
Jul 26, 2011
Jul 26, 2011
139
/* Initialize video modes */
140
141
BE_InitModes(_this);
Jul 26, 2011
Jul 26, 2011
142
143
144
145
/* Init the keymap */
BE_InitOSKeymap();
146
147
148
149
150
151
152
153
154
155
#if SDL_VIDEO_OPENGL
/* testgl application doesn't load library, just tries to load symbols */
/* is it correct? if so we have to load library here */
BE_GL_LoadLibrary(_this, NULL);
#endif
/* We're done! */
return (0);
}
Aug 22, 2011
Aug 22, 2011
156
int BE_Available(void)
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
{
return (1);
}
void BE_VideoQuit(_THIS)
{
BE_QuitModes(_this);
SDL_QuitBeApp();
}
#ifdef __cplusplus
}
#endif
Oct 31, 2011
Oct 31, 2011
172
173
#endif /* SDL_VIDEO_DRIVER_BWINDOW */