opengl: Pointer, newline cleanup, no functional change
* Clean up pointer positions * Clean up function line returns
This commit is contained in:
@@ -29,12 +29,12 @@ extern "C" {
|
||||
#define NAME(func) gl##func
|
||||
|
||||
#define DISPATCH(func, args, msg) \
|
||||
const struct _glapi_table *dispatch; \
|
||||
const struct _glapi_table* dispatch; \
|
||||
dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
|
||||
(dispatch->func) args
|
||||
|
||||
#define RETURN_DISPATCH(func, args, msg) \
|
||||
const struct _glapi_table *dispatch; \
|
||||
const struct _glapi_table* dispatch; \
|
||||
dispatch = _glapi_Dispatch ? _glapi_Dispatch : _glapi_get_dispatch();\
|
||||
return (dispatch->func) args
|
||||
|
||||
@@ -59,7 +59,7 @@ BGLDispatcher::~BGLDispatcher()
|
||||
|
||||
|
||||
status_t
|
||||
BGLDispatcher::CheckTable(const struct _glapi_table *table)
|
||||
BGLDispatcher::CheckTable(const struct _glapi_table* table)
|
||||
{
|
||||
_glapi_check_table(table ? table : _glapi_get_dispatch());
|
||||
return B_OK;
|
||||
@@ -67,7 +67,7 @@ BGLDispatcher::CheckTable(const struct _glapi_table *table)
|
||||
|
||||
|
||||
status_t
|
||||
BGLDispatcher::SetTable(struct _glapi_table *table)
|
||||
BGLDispatcher::SetTable(struct _glapi_table* table)
|
||||
{
|
||||
_glapi_set_dispatch(table);
|
||||
return B_OK;
|
||||
|
||||
@@ -30,67 +30,75 @@ class BGLDispatcher
|
||||
BGLDispatcher();
|
||||
~BGLDispatcher();
|
||||
|
||||
void SetCurrentContext(void * context);
|
||||
void * CurrentContext();
|
||||
void SetCurrentContext(void* context);
|
||||
void* CurrentContext();
|
||||
|
||||
struct _glapi_table * Table();
|
||||
struct _glapi_table* Table();
|
||||
status_t CheckTable(
|
||||
const struct _glapi_table *dispatch = NULL);
|
||||
status_t SetTable(struct _glapi_table *dispatch);
|
||||
const struct _glapi_table* dispatch = NULL);
|
||||
status_t SetTable(struct _glapi_table* dispatch);
|
||||
uint32 TableSize();
|
||||
|
||||
const _glapi_proc operator[](const char *functionName);
|
||||
const char * operator[](uint32 offset);
|
||||
const _glapi_proc operator[](const char* functionName);
|
||||
const char* operator[](uint32 offset);
|
||||
|
||||
const _glapi_proc AddressOf(const char *functionName);
|
||||
uint32 OffsetOf(const char *functionName);
|
||||
const _glapi_proc AddressOf(const char* functionName);
|
||||
uint32 OffsetOf(const char* functionName);
|
||||
};
|
||||
|
||||
|
||||
// Inlines methods
|
||||
inline void BGLDispatcher::SetCurrentContext(void * context)
|
||||
inline void
|
||||
BGLDispatcher::SetCurrentContext(void* context)
|
||||
{
|
||||
_glapi_set_context(context);
|
||||
}
|
||||
|
||||
|
||||
inline void * BGLDispatcher::CurrentContext()
|
||||
inline void*
|
||||
BGLDispatcher::CurrentContext()
|
||||
{
|
||||
return _glapi_get_context();
|
||||
}
|
||||
|
||||
|
||||
inline struct _glapi_table * BGLDispatcher::Table()
|
||||
inline struct _glapi_table*
|
||||
BGLDispatcher::Table()
|
||||
{
|
||||
return _glapi_get_dispatch();
|
||||
}
|
||||
|
||||
|
||||
inline uint32 BGLDispatcher::TableSize()
|
||||
inline uint32
|
||||
BGLDispatcher::TableSize()
|
||||
{
|
||||
return _glapi_get_dispatch_table_size();
|
||||
}
|
||||
|
||||
|
||||
inline const _glapi_proc BGLDispatcher::operator[](const char *functionName)
|
||||
inline const _glapi_proc
|
||||
BGLDispatcher::operator[](const char* functionName)
|
||||
{
|
||||
return _glapi_get_proc_address(functionName);
|
||||
}
|
||||
|
||||
|
||||
inline const char * BGLDispatcher::operator[](uint32 offset)
|
||||
inline const char*
|
||||
BGLDispatcher::operator[](uint32 offset)
|
||||
{
|
||||
return _glapi_get_proc_name((GLuint) offset);
|
||||
}
|
||||
|
||||
|
||||
inline const _glapi_proc BGLDispatcher::AddressOf(const char *functionName)
|
||||
inline const _glapi_proc
|
||||
BGLDispatcher::AddressOf(const char* functionName)
|
||||
{
|
||||
return _glapi_get_proc_address(functionName);
|
||||
}
|
||||
|
||||
|
||||
inline uint32 BGLDispatcher::OffsetOf(const char *functionName)
|
||||
inline uint32
|
||||
BGLDispatcher::OffsetOf(const char* functionName)
|
||||
{
|
||||
return (uint32) _glapi_get_proc_offset(functionName);
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#include "GLDispatcher.h"
|
||||
|
||||
|
||||
BGLRenderer::BGLRenderer(BGLView *view, ulong glOptions,
|
||||
BGLDispatcher *dispatcher)
|
||||
BGLRenderer::BGLRenderer(BGLView* view, ulong glOptions,
|
||||
BGLDispatcher* dispatcher)
|
||||
:
|
||||
fRefCount(1),
|
||||
fView(view),
|
||||
@@ -66,14 +66,14 @@ BGLRenderer::Draw(BRect updateRect)
|
||||
|
||||
|
||||
status_t
|
||||
BGLRenderer::CopyPixelsOut(BPoint source, BBitmap *dest)
|
||||
BGLRenderer::CopyPixelsOut(BPoint source, BBitmap* dest)
|
||||
{
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BGLRenderer::CopyPixelsIn(BBitmap *source, BPoint dest)
|
||||
BGLRenderer::CopyPixelsIn(BBitmap* source, BPoint dest)
|
||||
{
|
||||
return B_ERROR;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ BGLRenderer::FrameResized(float width, float height)
|
||||
|
||||
|
||||
void
|
||||
BGLRenderer::DirectConnected(direct_buffer_info *info)
|
||||
BGLRenderer::DirectConnected(direct_buffer_info* info)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -97,8 +97,8 @@ BGLRenderer::EnableDirectMode(bool enabled)
|
||||
}
|
||||
|
||||
|
||||
status_t BGLRenderer::_Reserved_Renderer_0(int32 n, void *p) { return B_ERROR; }
|
||||
status_t BGLRenderer::_Reserved_Renderer_1(int32 n, void *p) { return B_ERROR; }
|
||||
status_t BGLRenderer::_Reserved_Renderer_2(int32 n, void *p) { return B_ERROR; }
|
||||
status_t BGLRenderer::_Reserved_Renderer_3(int32 n, void *p) { return B_ERROR; }
|
||||
status_t BGLRenderer::_Reserved_Renderer_4(int32 n, void *p) { return B_ERROR; }
|
||||
status_t BGLRenderer::_Reserved_Renderer_0(int32 n, void* p) { return B_ERROR; }
|
||||
status_t BGLRenderer::_Reserved_Renderer_1(int32 n, void* p) { return B_ERROR; }
|
||||
status_t BGLRenderer::_Reserved_Renderer_2(int32 n, void* p) { return B_ERROR; }
|
||||
status_t BGLRenderer::_Reserved_Renderer_3(int32 n, void* p) { return B_ERROR; }
|
||||
status_t BGLRenderer::_Reserved_Renderer_4(int32 n, void* p) { return B_ERROR; }
|
||||
|
||||
@@ -21,12 +21,13 @@
|
||||
#include <string.h>
|
||||
|
||||
|
||||
extern "C" status_t _kern_get_safemode_option(const char *parameter,
|
||||
char *buffer, size_t *_bufferSize);
|
||||
extern "C" status_t _kern_get_safemode_option(const char* parameter,
|
||||
char* buffer, size_t* _bufferSize);
|
||||
|
||||
|
||||
GLRendererRoster::GLRendererRoster(BGLView *view, ulong options)
|
||||
: fNextID(0),
|
||||
GLRendererRoster::GLRendererRoster(BGLView* view, ulong options)
|
||||
:
|
||||
fNextID(0),
|
||||
fView(view),
|
||||
fOptions(options),
|
||||
fSafeMode(false),
|
||||
@@ -78,7 +79,7 @@ GLRendererRoster::~GLRendererRoster()
|
||||
}
|
||||
|
||||
|
||||
BGLRenderer *
|
||||
BGLRenderer*
|
||||
GLRendererRoster::GetRenderer(int32 id)
|
||||
{
|
||||
RendererMap::const_iterator iterator = fRenderers.find(id);
|
||||
@@ -193,13 +194,13 @@ GLRendererRoster::CreateRenderer(const entry_ref& ref)
|
||||
if (image < B_OK)
|
||||
return image;
|
||||
|
||||
BGLRenderer *(*instantiate_renderer)
|
||||
(BGLView *view, ulong options, BGLDispatcher *dispatcher);
|
||||
BGLRenderer* (*instantiate_renderer)
|
||||
(BGLView* view, ulong options, BGLDispatcher* dispatcher);
|
||||
|
||||
status = get_image_symbol(image, "instantiate_gl_renderer",
|
||||
B_SYMBOL_TYPE_TEXT, (void**)&instantiate_renderer);
|
||||
if (status == B_OK) {
|
||||
BGLRenderer *renderer
|
||||
BGLRenderer* renderer
|
||||
= instantiate_renderer(fView, fOptions, new BGLDispatcher());
|
||||
if (!renderer) {
|
||||
unload_add_on(image);
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
|
||||
struct renderer_item {
|
||||
BGLRenderer *renderer;
|
||||
BGLRenderer* renderer;
|
||||
entry_ref ref;
|
||||
ino_t node;
|
||||
image_id image;
|
||||
@@ -23,10 +23,10 @@ typedef std::map<renderer_id, renderer_item> RendererMap;
|
||||
|
||||
class GLRendererRoster {
|
||||
public:
|
||||
GLRendererRoster(BGLView *view, ulong options);
|
||||
GLRendererRoster(BGLView* view, ulong options);
|
||||
virtual ~GLRendererRoster();
|
||||
|
||||
BGLRenderer *GetRenderer(int32 id = 0);
|
||||
BGLRenderer* GetRenderer(int32 id = 0);
|
||||
|
||||
private:
|
||||
void AddDefaultPaths();
|
||||
@@ -37,7 +37,7 @@ class GLRendererRoster {
|
||||
|
||||
RendererMap fRenderers;
|
||||
int32 fNextID;
|
||||
BGLView *fView;
|
||||
BGLView* fView;
|
||||
ulong fOptions;
|
||||
bool fSafeMode;
|
||||
const char* fABISubDirectory;
|
||||
|
||||
+39
-40
@@ -25,7 +25,7 @@
|
||||
|
||||
|
||||
struct glview_direct_info {
|
||||
direct_buffer_info *direct_info;
|
||||
direct_buffer_info* direct_info;
|
||||
bool direct_connected;
|
||||
bool enable_direct_mode;
|
||||
|
||||
@@ -101,7 +101,7 @@ BGLView::SwapBuffers(bool vSync)
|
||||
}
|
||||
|
||||
|
||||
BView *
|
||||
BView*
|
||||
BGLView::EmbeddedView()
|
||||
{
|
||||
return NULL;
|
||||
@@ -124,7 +124,7 @@ BGLView::GetGLProcAddress(const char* procName)
|
||||
|
||||
|
||||
status_t
|
||||
BGLView::CopyPixelsOut(BPoint source, BBitmap *dest)
|
||||
BGLView::CopyPixelsOut(BPoint source, BBitmap* dest)
|
||||
{
|
||||
if (!fRenderer)
|
||||
return B_ERROR;
|
||||
@@ -137,7 +137,7 @@ BGLView::CopyPixelsOut(BPoint source, BBitmap *dest)
|
||||
|
||||
|
||||
status_t
|
||||
BGLView::CopyPixelsIn(BBitmap *source, BPoint dest)
|
||||
BGLView::CopyPixelsIn(BBitmap* source, BPoint dest)
|
||||
{
|
||||
if (!fRenderer)
|
||||
return B_ERROR;
|
||||
@@ -185,7 +185,7 @@ BGLView::AttachedToWindow()
|
||||
BView::AttachedToWindow();
|
||||
|
||||
fBounds = Bounds();
|
||||
for (BView *view = this; view != NULL; view = view->Parent())
|
||||
for (BView* view = this; view != NULL; view = view->Parent())
|
||||
view->ConvertToParent(&fBounds);
|
||||
|
||||
fRenderer = fRoster->GetRenderer();
|
||||
@@ -255,7 +255,7 @@ void
|
||||
BGLView::FrameResized(float width, float height)
|
||||
{
|
||||
fBounds = Bounds();
|
||||
for (BView *v = this; v; v = v->Parent())
|
||||
for (BView* v = this; v; v = v->Parent())
|
||||
v->ConvertToParent(&fBounds);
|
||||
|
||||
if (fRenderer) {
|
||||
@@ -267,26 +267,26 @@ BGLView::FrameResized(float width, float height)
|
||||
UnlockGL();
|
||||
}
|
||||
|
||||
BView::FrameResized(width, height);
|
||||
BView::FrameResized(width, height);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BGLView::Perform(perform_code d, void *arg)
|
||||
BGLView::Perform(perform_code d, void* arg)
|
||||
{
|
||||
return BView::Perform(d, arg);
|
||||
return BView::Perform(d, arg);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BGLView::Archive(BMessage *data, bool deep) const
|
||||
BGLView::Archive(BMessage* data, bool deep) const
|
||||
{
|
||||
return BView::Archive(data, deep);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BGLView::MessageReceived(BMessage *msg)
|
||||
BGLView::MessageReceived(BMessage* msg)
|
||||
{
|
||||
BView::MessageReceived(msg);
|
||||
}
|
||||
@@ -323,23 +323,23 @@ BGLView::Hide()
|
||||
}
|
||||
|
||||
|
||||
BHandler *
|
||||
BGLView::ResolveSpecifier(BMessage *msg, int32 index, BMessage *specifier,
|
||||
int32 form, const char *property)
|
||||
BHandler*
|
||||
BGLView::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier,
|
||||
int32 form, const char* property)
|
||||
{
|
||||
return BView::ResolveSpecifier(msg, index, specifier, form, property);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BGLView::GetSupportedSuites(BMessage *data)
|
||||
BGLView::GetSupportedSuites(BMessage* data)
|
||||
{
|
||||
return BView::GetSupportedSuites(data);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BGLView::DirectConnected(direct_buffer_info *info)
|
||||
BGLView::DirectConnected(direct_buffer_info* info)
|
||||
{
|
||||
if (fClipInfo == NULL) {
|
||||
fClipInfo = new (std::nothrow) glview_direct_info();
|
||||
@@ -347,7 +347,7 @@ BGLView::DirectConnected(direct_buffer_info *info)
|
||||
return;
|
||||
}
|
||||
|
||||
direct_buffer_info *localInfo = fClipInfo->direct_info;
|
||||
direct_buffer_info* localInfo = fClipInfo->direct_info;
|
||||
|
||||
switch (info->buffer_state & B_DIRECT_MODE_MASK) {
|
||||
case B_DIRECT_START:
|
||||
@@ -414,8 +414,8 @@ BGLView::_CallDirectConnected()
|
||||
if (!fClipInfo)
|
||||
return;
|
||||
|
||||
direct_buffer_info *localInfo = fClipInfo->direct_info;
|
||||
direct_buffer_info *info = (direct_buffer_info *)malloc(
|
||||
direct_buffer_info* localInfo = fClipInfo->direct_info;
|
||||
direct_buffer_info* info = (direct_buffer_info*)malloc(
|
||||
DIRECT_BUFFER_INFO_AREA_SIZE);
|
||||
if (info == NULL)
|
||||
return;
|
||||
@@ -479,13 +479,11 @@ BGLView::BGLView(BRect rect, char* name, ulong resizingMode, ulong mode,
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
|
||||
// TODO: implement BGLScreen class...
|
||||
|
||||
|
||||
BGLScreen::BGLScreen(char* name, ulong screenMode, ulong options,
|
||||
status_t *error, bool debug)
|
||||
status_t* error, bool debug)
|
||||
:
|
||||
BWindowScreen(name, screenMode, error, debug)
|
||||
{
|
||||
@@ -536,57 +534,58 @@ BGLScreen::ScreenConnected(bool enabled)
|
||||
void
|
||||
BGLScreen::FrameResized(float width, float height)
|
||||
{
|
||||
return BWindowScreen::FrameResized(width, height);
|
||||
return BWindowScreen::FrameResized(width, height);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BGLScreen::Perform(perform_code d, void *arg)
|
||||
BGLScreen::Perform(perform_code d, void* arg)
|
||||
{
|
||||
return BWindowScreen::Perform(d, arg);
|
||||
return BWindowScreen::Perform(d, arg);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BGLScreen::Archive(BMessage *data, bool deep) const
|
||||
BGLScreen::Archive(BMessage* data, bool deep) const
|
||||
{
|
||||
return BWindowScreen::Archive(data, deep);
|
||||
return BWindowScreen::Archive(data, deep);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BGLScreen::MessageReceived(BMessage *msg)
|
||||
BGLScreen::MessageReceived(BMessage* msg)
|
||||
{
|
||||
BWindowScreen::MessageReceived(msg);
|
||||
BWindowScreen::MessageReceived(msg);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BGLScreen::Show()
|
||||
{
|
||||
BWindowScreen::Show();
|
||||
BWindowScreen::Show();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BGLScreen::Hide()
|
||||
{
|
||||
BWindowScreen::Hide();
|
||||
BWindowScreen::Hide();
|
||||
}
|
||||
|
||||
|
||||
BHandler *
|
||||
BGLScreen::ResolveSpecifier(BMessage *msg, int32 index, BMessage *specifier,
|
||||
int32 form, const char *property)
|
||||
BHandler*
|
||||
BGLScreen::ResolveSpecifier(BMessage* msg, int32 index, BMessage* specifier,
|
||||
int32 form, const char* property)
|
||||
{
|
||||
return BWindowScreen::ResolveSpecifier(msg, index, specifier, form, property);
|
||||
return BWindowScreen::ResolveSpecifier(msg, index, specifier,
|
||||
form, property);
|
||||
}
|
||||
|
||||
|
||||
status_t
|
||||
BGLScreen::GetSupportedSuites(BMessage *data)
|
||||
BGLScreen::GetSupportedSuites(BMessage* data)
|
||||
{
|
||||
return BWindowScreen::GetSupportedSuites(data);
|
||||
return BWindowScreen::GetSupportedSuites(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -600,10 +599,10 @@ void BGLScreen::_ReservedGLScreen5() {}
|
||||
void BGLScreen::_ReservedGLScreen6() {}
|
||||
void BGLScreen::_ReservedGLScreen7() {}
|
||||
void BGLScreen::_ReservedGLScreen8() {}
|
||||
|
||||
#endif
|
||||
|
||||
const char * color_space_name(color_space space)
|
||||
|
||||
const char* color_space_name(color_space space)
|
||||
{
|
||||
#define C2N(a) case a: return #a
|
||||
|
||||
@@ -630,7 +629,7 @@ const char * color_space_name(color_space space)
|
||||
glview_direct_info::glview_direct_info()
|
||||
{
|
||||
// TODO: See direct_window_data() in app_server's ServerWindow.cpp
|
||||
direct_info = (direct_buffer_info *)calloc(1, DIRECT_BUFFER_INFO_AREA_SIZE);
|
||||
direct_info = (direct_buffer_info*)calloc(1, DIRECT_BUFFER_INFO_AREA_SIZE);
|
||||
direct_connected = false;
|
||||
enable_direct_mode = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user