* Renamed the folder to avoid confusion about the location
of Mesa framework (src/kits/opengl/mesa) and make clearer here live the Mesa Software Renderer add-on for Haiku's OpenGL stack. * Renamed the class for the same reason. * Changed the string returned for GL_RENDERER to help sorting out Haiku's renderer add-on(s) from Mesa3D BeOS ports's monolithic libGL.so renderer. * Make the renderer context current if none is already. This fix the need in GLInfo to call LockGL() before calling any glGet*() calls, when it was not necessary under R5 (and Mesa3D beos ports) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19287 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
SubDir HAIKU_TOP src add-ons opengl ;
|
SubDir HAIKU_TOP src add-ons opengl ;
|
||||||
|
|
||||||
SubInclude HAIKU_TOP src add-ons opengl mesa ;
|
SubInclude HAIKU_TOP src add-ons opengl mesa_software_renderer ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
SubDir HAIKU_TOP src add-ons opengl mesa ;
|
SubDir HAIKU_TOP src add-ons opengl mesa_software_renderer ;
|
||||||
|
|
||||||
SetSubDirSupportedPlatformsBeOSCompatible ;
|
SetSubDirSupportedPlatformsBeOSCompatible ;
|
||||||
|
|
||||||
@@ -29,8 +29,8 @@ UseHeaders [ FDirName $(HAIKU_TOP) src kits opengl mesa main ] ;
|
|||||||
UseHeaders [ FDirName $(HAIKU_TOP) src kits opengl mesa glapi ] ;
|
UseHeaders [ FDirName $(HAIKU_TOP) src kits opengl mesa glapi ] ;
|
||||||
UseHeaders [ FDirName $(HAIKU_TOP) src kits opengl mesa tnl ] ;
|
UseHeaders [ FDirName $(HAIKU_TOP) src kits opengl mesa tnl ] ;
|
||||||
|
|
||||||
Addon mesa_soft : opengl :
|
Addon Mesa\ Software\ Renderer : opengl :
|
||||||
MesaSoftRenderer.cpp
|
MesaSoftwareRenderer.cpp
|
||||||
: false
|
: false
|
||||||
: libGL.so libmesa.a be
|
: libGL.so libmesa.a be
|
||||||
;
|
;
|
||||||
+77
-69
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#define CALLED() //printf("CALLED %s\n",__PRETTY_FUNCTION__)
|
#define CALLED() //printf("CALLED %s\n",__PRETTY_FUNCTION__)
|
||||||
|
|
||||||
#include "MesaSoftRenderer.h"
|
#include "MesaSoftwareRenderer.h"
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "array_cache/acache.h"
|
#include "array_cache/acache.h"
|
||||||
#include "extensions.h"
|
#include "extensions.h"
|
||||||
@@ -58,11 +58,11 @@ extern const char * color_space_name(color_space space);
|
|||||||
extern "C" _EXPORT BGLRenderer *
|
extern "C" _EXPORT BGLRenderer *
|
||||||
instanciate_gl_renderer(BGLView *view, ulong options, BGLDispatcher *dispatcher)
|
instanciate_gl_renderer(BGLView *view, ulong options, BGLDispatcher *dispatcher)
|
||||||
{
|
{
|
||||||
return new MesaSoftRenderer(view, options, dispatcher);
|
return new MesaSoftwareRenderer(view, options, dispatcher);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MesaSoftRenderer::MesaSoftRenderer(BGLView *view, ulong options, BGLDispatcher *dispatcher)
|
MesaSoftwareRenderer::MesaSoftwareRenderer(BGLView *view, ulong options, BGLDispatcher *dispatcher)
|
||||||
: BGLRenderer(view, options, dispatcher),
|
: BGLRenderer(view, options, dispatcher),
|
||||||
fBitmap(NULL),
|
fBitmap(NULL),
|
||||||
fContext(NULL),
|
fContext(NULL),
|
||||||
@@ -134,7 +134,7 @@ MesaSoftRenderer::MesaSoftRenderer(BGLView *view, ulong options, BGLDispatcher *
|
|||||||
_swsetup_CreateContext(fContext);
|
_swsetup_CreateContext(fContext);
|
||||||
_swsetup_Wakeup(fContext);
|
_swsetup_Wakeup(fContext);
|
||||||
|
|
||||||
MesaSoftRenderer * mr = (MesaSoftRenderer *) fContext->DriverCtx;
|
MesaSoftwareRenderer * mr = (MesaSoftwareRenderer *) fContext->DriverCtx;
|
||||||
struct swrast_device_driver * swdd = _swrast_GetDeviceDriverReference( fContext );
|
struct swrast_device_driver * swdd = _swrast_GetDeviceDriverReference( fContext );
|
||||||
TNLcontext * tnl = TNL_CONTEXT(fContext);
|
TNLcontext * tnl = TNL_CONTEXT(fContext);
|
||||||
|
|
||||||
@@ -146,9 +146,17 @@ MesaSoftRenderer::MesaSoftRenderer(BGLView *view, ulong options, BGLDispatcher *
|
|||||||
tnl->Driver.RunPipeline = _tnl_run_pipeline;
|
tnl->Driver.RunPipeline = _tnl_run_pipeline;
|
||||||
|
|
||||||
swdd->SetBuffer = this->SetBuffer;
|
swdd->SetBuffer = this->SetBuffer;
|
||||||
|
|
||||||
|
// some stupid applications (Quake2) don't even think about calling LockGL()
|
||||||
|
// before using glGetString and its glGet*() friends...
|
||||||
|
// so make sure there is at least a valid context.
|
||||||
|
if (!_mesa_get_current_context()) {
|
||||||
|
LockGL();
|
||||||
|
// not needed, we don't have a looper yet: UnlockLooper();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MesaSoftRenderer::~MesaSoftRenderer()
|
MesaSoftwareRenderer::~MesaSoftwareRenderer()
|
||||||
{
|
{
|
||||||
_mesa_destroy_visual(fVisual);
|
_mesa_destroy_visual(fVisual);
|
||||||
_mesa_destroy_framebuffer(fFrameBuffer);
|
_mesa_destroy_framebuffer(fFrameBuffer);
|
||||||
@@ -159,7 +167,7 @@ MesaSoftRenderer::~MesaSoftRenderer()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::LockGL()
|
MesaSoftwareRenderer::LockGL()
|
||||||
{
|
{
|
||||||
BGLRenderer::LockGL();
|
BGLRenderer::LockGL();
|
||||||
|
|
||||||
@@ -169,7 +177,7 @@ MesaSoftRenderer::LockGL()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::UnlockGL()
|
MesaSoftwareRenderer::UnlockGL()
|
||||||
{
|
{
|
||||||
|
|
||||||
BGLRenderer::UnlockGL();
|
BGLRenderer::UnlockGL();
|
||||||
@@ -177,7 +185,7 @@ MesaSoftRenderer::UnlockGL()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::SwapBuffers(bool VSync)
|
MesaSoftwareRenderer::SwapBuffers(bool VSync)
|
||||||
{
|
{
|
||||||
_mesa_notifySwapBuffers(fContext);
|
_mesa_notifySwapBuffers(fContext);
|
||||||
|
|
||||||
@@ -191,7 +199,7 @@ MesaSoftRenderer::SwapBuffers(bool VSync)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::Draw(BRect updateRect)
|
MesaSoftwareRenderer::Draw(BRect updateRect)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
if (fBitmap)
|
if (fBitmap)
|
||||||
@@ -200,7 +208,7 @@ MesaSoftRenderer::Draw(BRect updateRect)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
MesaSoftRenderer::CopyPixelsOut(BPoint location, BBitmap *bitmap)
|
MesaSoftwareRenderer::CopyPixelsOut(BPoint location, BBitmap *bitmap)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
color_space scs = fBitmap->ColorSpace();
|
color_space scs = fBitmap->ColorSpace();
|
||||||
@@ -237,7 +245,7 @@ MesaSoftRenderer::CopyPixelsOut(BPoint location, BBitmap *bitmap)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
MesaSoftRenderer::CopyPixelsIn(BBitmap *bitmap, BPoint location)
|
MesaSoftwareRenderer::CopyPixelsIn(BBitmap *bitmap, BPoint location)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
color_space scs = bitmap->ColorSpace();
|
color_space scs = bitmap->ColorSpace();
|
||||||
@@ -274,7 +282,7 @@ MesaSoftRenderer::CopyPixelsIn(BBitmap *bitmap, BPoint location)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::Viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
|
MesaSoftwareRenderer::Viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
/* poll for window size change and realloc software Z/stencil/etc if needed */
|
/* poll for window size change and realloc software Z/stencil/etc if needed */
|
||||||
@@ -283,11 +291,11 @@ MesaSoftRenderer::Viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei
|
|||||||
|
|
||||||
|
|
||||||
const GLubyte *
|
const GLubyte *
|
||||||
MesaSoftRenderer::GetString(GLcontext *ctx, GLenum name)
|
MesaSoftwareRenderer::GetString(GLcontext *ctx, GLenum name)
|
||||||
{
|
{
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case GL_RENDERER:
|
case GL_RENDERER:
|
||||||
return (const GLubyte *) "Mesa " MESA_VERSION_STRING " powered BGLView (software)";
|
return (const GLubyte *) "Haiku's OpenGL Software Renderer, powered by Mesa " MESA_VERSION_STRING ;
|
||||||
default:
|
default:
|
||||||
// Let core library handle all other cases
|
// Let core library handle all other cases
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -296,30 +304,30 @@ MesaSoftRenderer::GetString(GLcontext *ctx, GLenum name)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::Error(GLcontext *ctx)
|
MesaSoftwareRenderer::Error(GLcontext *ctx)
|
||||||
{
|
{
|
||||||
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
if (mr && mr->GLView())
|
if (mr && mr->GLView())
|
||||||
mr->GLView()->ErrorCallback((unsigned long) ctx->ErrorValue);
|
mr->GLView()->ErrorCallback((unsigned long) ctx->ErrorValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::ClearIndex(GLcontext *ctx, GLuint index)
|
MesaSoftwareRenderer::ClearIndex(GLcontext *ctx, GLuint index)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
mr->fClearIndex = index;
|
mr->fClearIndex = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::ClearColor(GLcontext *ctx, const GLfloat color[4])
|
MesaSoftwareRenderer::ClearColor(GLcontext *ctx, const GLfloat color[4])
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
CLAMPED_FLOAT_TO_CHAN(mr->fClearColor[BE_RCOMP], color[0]);
|
CLAMPED_FLOAT_TO_CHAN(mr->fClearColor[BE_RCOMP], color[0]);
|
||||||
CLAMPED_FLOAT_TO_CHAN(mr->fClearColor[BE_GCOMP], color[1]);
|
CLAMPED_FLOAT_TO_CHAN(mr->fClearColor[BE_GCOMP], color[1]);
|
||||||
CLAMPED_FLOAT_TO_CHAN(mr->fClearColor[BE_BCOMP], color[2]);
|
CLAMPED_FLOAT_TO_CHAN(mr->fClearColor[BE_BCOMP], color[2]);
|
||||||
@@ -329,7 +337,7 @@ MesaSoftRenderer::ClearColor(GLcontext *ctx, const GLfloat color[4])
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::Clear(GLcontext *ctx, GLbitfield mask,
|
MesaSoftwareRenderer::Clear(GLcontext *ctx, GLbitfield mask,
|
||||||
GLboolean all, GLint x, GLint y,
|
GLboolean all, GLint x, GLint y,
|
||||||
GLint width, GLint height)
|
GLint width, GLint height)
|
||||||
{
|
{
|
||||||
@@ -346,13 +354,13 @@ MesaSoftRenderer::Clear(GLcontext *ctx, GLbitfield mask,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::ClearFront(GLcontext *ctx,
|
MesaSoftwareRenderer::ClearFront(GLcontext *ctx,
|
||||||
GLboolean all, GLint x, GLint y,
|
GLboolean all, GLint x, GLint y,
|
||||||
GLint width, GLint height)
|
GLint width, GLint height)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
BGLView *bglview = mr->GLView();
|
BGLView *bglview = mr->GLView();
|
||||||
assert(bglview);
|
assert(bglview);
|
||||||
|
|
||||||
@@ -392,13 +400,13 @@ MesaSoftRenderer::ClearFront(GLcontext *ctx,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::ClearBack(GLcontext *ctx,
|
MesaSoftwareRenderer::ClearBack(GLcontext *ctx,
|
||||||
GLboolean all, GLint x, GLint y,
|
GLboolean all, GLint x, GLint y,
|
||||||
GLint width, GLint height)
|
GLint width, GLint height)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
BGLView *bglview = mr->GLView();
|
BGLView *bglview = mr->GLView();
|
||||||
assert(bglview);
|
assert(bglview);
|
||||||
BBitmap *bitmap = mr->fBitmap;
|
BBitmap *bitmap = mr->fBitmap;
|
||||||
@@ -430,7 +438,7 @@ MesaSoftRenderer::ClearBack(GLcontext *ctx,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::UpdateState( GLcontext *ctx, GLuint new_state )
|
MesaSoftwareRenderer::UpdateState( GLcontext *ctx, GLuint new_state )
|
||||||
{
|
{
|
||||||
struct swrast_device_driver * swdd = _swrast_GetDeviceDriverReference( ctx );
|
struct swrast_device_driver * swdd = _swrast_GetDeviceDriverReference( ctx );
|
||||||
|
|
||||||
@@ -476,14 +484,14 @@ MesaSoftRenderer::UpdateState( GLcontext *ctx, GLuint new_state )
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::GetBufferSize(GLframebuffer * framebuffer, GLuint *width,
|
MesaSoftwareRenderer::GetBufferSize(GLframebuffer * framebuffer, GLuint *width,
|
||||||
GLuint *height)
|
GLuint *height)
|
||||||
{
|
{
|
||||||
GET_CURRENT_CONTEXT(ctx);
|
GET_CURRENT_CONTEXT(ctx);
|
||||||
if (!ctx)
|
if (!ctx)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MesaSoftRenderer * mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer * mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
BGLView *bglview = mr->GLView();
|
BGLView *bglview = mr->GLView();
|
||||||
assert(bglview);
|
assert(bglview);
|
||||||
|
|
||||||
@@ -510,7 +518,7 @@ MesaSoftRenderer::GetBufferSize(GLframebuffer * framebuffer, GLuint *width,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::SetBuffer(GLcontext *ctx, GLframebuffer *buffer,
|
MesaSoftwareRenderer::SetBuffer(GLcontext *ctx, GLframebuffer *buffer,
|
||||||
GLenum mode)
|
GLenum mode)
|
||||||
{
|
{
|
||||||
/* TODO */
|
/* TODO */
|
||||||
@@ -531,14 +539,14 @@ inline void Plot(BGLView *bglview, int x, int y)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteRGBASpanFront(const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::WriteRGBASpanFront(const GLcontext *ctx, GLuint n,
|
||||||
GLint x, GLint y,
|
GLint x, GLint y,
|
||||||
CONST GLubyte rgba[][4],
|
CONST GLubyte rgba[][4],
|
||||||
const GLubyte mask[])
|
const GLubyte mask[])
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
BGLView *bglview = mr->GLView();
|
BGLView *bglview = mr->GLView();
|
||||||
assert(bglview);
|
assert(bglview);
|
||||||
int flippedY = mr->fBottom - y;
|
int flippedY = mr->fBottom - y;
|
||||||
@@ -559,14 +567,14 @@ MesaSoftRenderer::WriteRGBASpanFront(const GLcontext *ctx, GLuint n,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteRGBSpanFront(const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::WriteRGBSpanFront(const GLcontext *ctx, GLuint n,
|
||||||
GLint x, GLint y,
|
GLint x, GLint y,
|
||||||
CONST GLubyte rgba[][3],
|
CONST GLubyte rgba[][3],
|
||||||
const GLubyte mask[])
|
const GLubyte mask[])
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
BGLView *bglview = mr->GLView();
|
BGLView *bglview = mr->GLView();
|
||||||
assert(bglview);
|
assert(bglview);
|
||||||
int flippedY = mr->fBottom - y;
|
int flippedY = mr->fBottom - y;
|
||||||
@@ -587,14 +595,14 @@ MesaSoftRenderer::WriteRGBSpanFront(const GLcontext *ctx, GLuint n,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteMonoRGBASpanFront(const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::WriteMonoRGBASpanFront(const GLcontext *ctx, GLuint n,
|
||||||
GLint x, GLint y,
|
GLint x, GLint y,
|
||||||
const GLchan color[4],
|
const GLchan color[4],
|
||||||
const GLubyte mask[])
|
const GLubyte mask[])
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
BGLView *bglview = mr->GLView();
|
BGLView *bglview = mr->GLView();
|
||||||
assert(bglview);
|
assert(bglview);
|
||||||
int flippedY = mr->fBottom - y;
|
int flippedY = mr->fBottom - y;
|
||||||
@@ -613,13 +621,13 @@ MesaSoftRenderer::WriteMonoRGBASpanFront(const GLcontext *ctx, GLuint n,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteRGBAPixelsFront(const GLcontext *ctx,
|
MesaSoftwareRenderer::WriteRGBAPixelsFront(const GLcontext *ctx,
|
||||||
GLuint n, const GLint x[], const GLint y[],
|
GLuint n, const GLint x[], const GLint y[],
|
||||||
CONST GLubyte rgba[][4],
|
CONST GLubyte rgba[][4],
|
||||||
const GLubyte mask[] )
|
const GLubyte mask[] )
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
BGLView *bglview = mr->GLView();
|
BGLView *bglview = mr->GLView();
|
||||||
assert(bglview);
|
assert(bglview);
|
||||||
if (mask) {
|
if (mask) {
|
||||||
@@ -639,13 +647,13 @@ MesaSoftRenderer::WriteRGBAPixelsFront(const GLcontext *ctx,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteMonoRGBAPixelsFront(const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::WriteMonoRGBAPixelsFront(const GLcontext *ctx, GLuint n,
|
||||||
const GLint x[], const GLint y[],
|
const GLint x[], const GLint y[],
|
||||||
const GLchan color[4],
|
const GLchan color[4],
|
||||||
const GLubyte mask[])
|
const GLubyte mask[])
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
BGLView *bglview = mr->GLView();
|
BGLView *bglview = mr->GLView();
|
||||||
assert(bglview);
|
assert(bglview);
|
||||||
// plot points using current color
|
// plot points using current color
|
||||||
@@ -665,7 +673,7 @@ MesaSoftRenderer::WriteMonoRGBAPixelsFront(const GLcontext *ctx, GLuint n,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteCI32SpanFront( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
MesaSoftwareRenderer::WriteCI32SpanFront( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||||
const GLuint index[], const GLubyte mask[] )
|
const GLuint index[], const GLubyte mask[] )
|
||||||
{
|
{
|
||||||
printf("WriteCI32SpanFront() not implemented yet!\n");
|
printf("WriteCI32SpanFront() not implemented yet!\n");
|
||||||
@@ -673,7 +681,7 @@ MesaSoftRenderer::WriteCI32SpanFront( const GLcontext *ctx, GLuint n, GLint x, G
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteCI8SpanFront( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
MesaSoftwareRenderer::WriteCI8SpanFront( const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||||
const GLubyte index[], const GLubyte mask[] )
|
const GLubyte index[], const GLubyte mask[] )
|
||||||
{
|
{
|
||||||
printf("WriteCI8SpanFront() not implemented yet!\n");
|
printf("WriteCI8SpanFront() not implemented yet!\n");
|
||||||
@@ -681,7 +689,7 @@ MesaSoftRenderer::WriteCI8SpanFront( const GLcontext *ctx, GLuint n, GLint x, GL
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteMonoCISpanFront( const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::WriteMonoCISpanFront( const GLcontext *ctx, GLuint n,
|
||||||
GLint x, GLint y,
|
GLint x, GLint y,
|
||||||
GLuint colorIndex, const GLubyte mask[] )
|
GLuint colorIndex, const GLubyte mask[] )
|
||||||
{
|
{
|
||||||
@@ -691,7 +699,7 @@ MesaSoftRenderer::WriteMonoCISpanFront( const GLcontext *ctx, GLuint n,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteCI32PixelsFront( const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::WriteCI32PixelsFront( const GLcontext *ctx, GLuint n,
|
||||||
const GLint x[], const GLint y[],
|
const GLint x[], const GLint y[],
|
||||||
const GLuint index[], const GLubyte mask[] )
|
const GLuint index[], const GLubyte mask[] )
|
||||||
{
|
{
|
||||||
@@ -700,7 +708,7 @@ MesaSoftRenderer::WriteCI32PixelsFront( const GLcontext *ctx, GLuint n,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteMonoCIPixelsFront( const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::WriteMonoCIPixelsFront( const GLcontext *ctx, GLuint n,
|
||||||
const GLint x[], const GLint y[],
|
const GLint x[], const GLint y[],
|
||||||
GLuint colorIndex, const GLubyte mask[] )
|
GLuint colorIndex, const GLubyte mask[] )
|
||||||
{
|
{
|
||||||
@@ -710,7 +718,7 @@ MesaSoftRenderer::WriteMonoCIPixelsFront( const GLcontext *ctx, GLuint n,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::ReadCI32SpanFront( const GLcontext *ctx,
|
MesaSoftwareRenderer::ReadCI32SpanFront( const GLcontext *ctx,
|
||||||
GLuint n, GLint x, GLint y, GLuint index[] )
|
GLuint n, GLint x, GLint y, GLuint index[] )
|
||||||
{
|
{
|
||||||
printf("ReadCI32SpanFront() not implemented yet!\n");
|
printf("ReadCI32SpanFront() not implemented yet!\n");
|
||||||
@@ -719,7 +727,7 @@ MesaSoftRenderer::ReadCI32SpanFront( const GLcontext *ctx,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::ReadRGBASpanFront( const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::ReadRGBASpanFront( const GLcontext *ctx, GLuint n,
|
||||||
GLint x, GLint y, GLubyte rgba[][4] )
|
GLint x, GLint y, GLubyte rgba[][4] )
|
||||||
{
|
{
|
||||||
printf("ReadRGBASpanFront() not implemented yet!\n");
|
printf("ReadRGBASpanFront() not implemented yet!\n");
|
||||||
@@ -728,7 +736,7 @@ MesaSoftRenderer::ReadRGBASpanFront( const GLcontext *ctx, GLuint n,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::ReadCI32PixelsFront( const GLcontext *ctx,
|
MesaSoftwareRenderer::ReadCI32PixelsFront( const GLcontext *ctx,
|
||||||
GLuint n, const GLint x[], const GLint y[],
|
GLuint n, const GLint x[], const GLint y[],
|
||||||
GLuint indx[], const GLubyte mask[] )
|
GLuint indx[], const GLubyte mask[] )
|
||||||
{
|
{
|
||||||
@@ -738,7 +746,7 @@ MesaSoftRenderer::ReadCI32PixelsFront( const GLcontext *ctx,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::ReadRGBAPixelsFront( const GLcontext *ctx,
|
MesaSoftwareRenderer::ReadRGBAPixelsFront( const GLcontext *ctx,
|
||||||
GLuint n, const GLint x[], const GLint y[],
|
GLuint n, const GLint x[], const GLint y[],
|
||||||
GLubyte rgba[][4], const GLubyte mask[] )
|
GLubyte rgba[][4], const GLubyte mask[] )
|
||||||
{
|
{
|
||||||
@@ -750,13 +758,13 @@ MesaSoftRenderer::ReadRGBAPixelsFront( const GLcontext *ctx,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteRGBASpanBack(const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::WriteRGBASpanBack(const GLcontext *ctx, GLuint n,
|
||||||
GLint x, GLint y,
|
GLint x, GLint y,
|
||||||
CONST GLubyte rgba[][4],
|
CONST GLubyte rgba[][4],
|
||||||
const GLubyte mask[])
|
const GLubyte mask[])
|
||||||
{
|
{
|
||||||
//CALLED();
|
//CALLED();
|
||||||
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
BBitmap *bitmap = mr->fBitmap;
|
BBitmap *bitmap = mr->fBitmap;
|
||||||
|
|
||||||
assert(bitmap);
|
assert(bitmap);
|
||||||
@@ -782,13 +790,13 @@ MesaSoftRenderer::WriteRGBASpanBack(const GLcontext *ctx, GLuint n,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteRGBSpanBack(const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::WriteRGBSpanBack(const GLcontext *ctx, GLuint n,
|
||||||
GLint x, GLint y,
|
GLint x, GLint y,
|
||||||
CONST GLubyte rgb[][3],
|
CONST GLubyte rgb[][3],
|
||||||
const GLubyte mask[])
|
const GLubyte mask[])
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
BBitmap *bitmap = mr->fBitmap;
|
BBitmap *bitmap = mr->fBitmap;
|
||||||
|
|
||||||
assert(bitmap);
|
assert(bitmap);
|
||||||
@@ -816,12 +824,12 @@ MesaSoftRenderer::WriteRGBSpanBack(const GLcontext *ctx, GLuint n,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteMonoRGBASpanBack(const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::WriteMonoRGBASpanBack(const GLcontext *ctx, GLuint n,
|
||||||
GLint x, GLint y,
|
GLint x, GLint y,
|
||||||
const GLchan color[4], const GLubyte mask[])
|
const GLchan color[4], const GLubyte mask[])
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
BBitmap *bitmap = mr->fBitmap;
|
BBitmap *bitmap = mr->fBitmap;
|
||||||
|
|
||||||
assert(bitmap);
|
assert(bitmap);
|
||||||
@@ -846,13 +854,13 @@ MesaSoftRenderer::WriteMonoRGBASpanBack(const GLcontext *ctx, GLuint n,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteRGBAPixelsBack(const GLcontext *ctx,
|
MesaSoftwareRenderer::WriteRGBAPixelsBack(const GLcontext *ctx,
|
||||||
GLuint n, const GLint x[], const GLint y[],
|
GLuint n, const GLint x[], const GLint y[],
|
||||||
CONST GLubyte rgba[][4],
|
CONST GLubyte rgba[][4],
|
||||||
const GLubyte mask[] )
|
const GLubyte mask[] )
|
||||||
{
|
{
|
||||||
//CALLED();
|
//CALLED();
|
||||||
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
BBitmap *bitmap = mr->fBitmap;
|
BBitmap *bitmap = mr->fBitmap;
|
||||||
|
|
||||||
assert(bitmap);
|
assert(bitmap);
|
||||||
@@ -894,13 +902,13 @@ MesaSoftRenderer::WriteRGBAPixelsBack(const GLcontext *ctx,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteMonoRGBAPixelsBack(const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::WriteMonoRGBAPixelsBack(const GLcontext *ctx, GLuint n,
|
||||||
const GLint x[], const GLint y[],
|
const GLint x[], const GLint y[],
|
||||||
const GLchan color[4],
|
const GLchan color[4],
|
||||||
const GLubyte mask[])
|
const GLubyte mask[])
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
BBitmap *bitmap = mr->fBitmap;
|
BBitmap *bitmap = mr->fBitmap;
|
||||||
|
|
||||||
assert(bitmap);
|
assert(bitmap);
|
||||||
@@ -938,7 +946,7 @@ MesaSoftRenderer::WriteMonoRGBAPixelsBack(const GLcontext *ctx, GLuint n,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteCI32SpanBack( const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::WriteCI32SpanBack( const GLcontext *ctx, GLuint n,
|
||||||
GLint x, GLint y,
|
GLint x, GLint y,
|
||||||
const GLuint index[], const GLubyte mask[] )
|
const GLuint index[], const GLubyte mask[] )
|
||||||
{
|
{
|
||||||
@@ -947,7 +955,7 @@ MesaSoftRenderer::WriteCI32SpanBack( const GLcontext *ctx, GLuint n,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteCI8SpanBack( const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::WriteCI8SpanBack( const GLcontext *ctx, GLuint n,
|
||||||
GLint x, GLint y,
|
GLint x, GLint y,
|
||||||
const GLubyte index[], const GLubyte mask[] )
|
const GLubyte index[], const GLubyte mask[] )
|
||||||
{
|
{
|
||||||
@@ -956,7 +964,7 @@ MesaSoftRenderer::WriteCI8SpanBack( const GLcontext *ctx, GLuint n,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteMonoCISpanBack( const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::WriteMonoCISpanBack( const GLcontext *ctx, GLuint n,
|
||||||
GLint x, GLint y,
|
GLint x, GLint y,
|
||||||
GLuint colorIndex, const GLubyte mask[] )
|
GLuint colorIndex, const GLubyte mask[] )
|
||||||
{
|
{
|
||||||
@@ -966,7 +974,7 @@ MesaSoftRenderer::WriteMonoCISpanBack( const GLcontext *ctx, GLuint n,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteCI32PixelsBack( const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::WriteCI32PixelsBack( const GLcontext *ctx, GLuint n,
|
||||||
const GLint x[], const GLint y[],
|
const GLint x[], const GLint y[],
|
||||||
const GLuint index[], const GLubyte mask[] )
|
const GLuint index[], const GLubyte mask[] )
|
||||||
{
|
{
|
||||||
@@ -975,7 +983,7 @@ MesaSoftRenderer::WriteCI32PixelsBack( const GLcontext *ctx, GLuint n,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::WriteMonoCIPixelsBack( const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::WriteMonoCIPixelsBack( const GLcontext *ctx, GLuint n,
|
||||||
const GLint x[], const GLint y[],
|
const GLint x[], const GLint y[],
|
||||||
GLuint colorIndex, const GLubyte mask[] )
|
GLuint colorIndex, const GLubyte mask[] )
|
||||||
{
|
{
|
||||||
@@ -985,7 +993,7 @@ MesaSoftRenderer::WriteMonoCIPixelsBack( const GLcontext *ctx, GLuint n,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::ReadCI32SpanBack( const GLcontext *ctx,
|
MesaSoftwareRenderer::ReadCI32SpanBack( const GLcontext *ctx,
|
||||||
GLuint n, GLint x, GLint y, GLuint index[] )
|
GLuint n, GLint x, GLint y, GLuint index[] )
|
||||||
{
|
{
|
||||||
printf("ReadCI32SpanBack() not implemented yet!\n");
|
printf("ReadCI32SpanBack() not implemented yet!\n");
|
||||||
@@ -994,11 +1002,11 @@ MesaSoftRenderer::ReadCI32SpanBack( const GLcontext *ctx,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::ReadRGBASpanBack( const GLcontext *ctx, GLuint n,
|
MesaSoftwareRenderer::ReadRGBASpanBack( const GLcontext *ctx, GLuint n,
|
||||||
GLint x, GLint y, GLubyte rgba[][4] )
|
GLint x, GLint y, GLubyte rgba[][4] )
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
const BBitmap *bitmap = mr->fBitmap;
|
const BBitmap *bitmap = mr->fBitmap;
|
||||||
assert(bitmap);
|
assert(bitmap);
|
||||||
int row = mr->fBottom - y;
|
int row = mr->fBottom - y;
|
||||||
@@ -1016,7 +1024,7 @@ MesaSoftRenderer::ReadRGBASpanBack( const GLcontext *ctx, GLuint n,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::ReadCI32PixelsBack( const GLcontext *ctx,
|
MesaSoftwareRenderer::ReadCI32PixelsBack( const GLcontext *ctx,
|
||||||
GLuint n, const GLint x[], const GLint y[],
|
GLuint n, const GLint x[], const GLint y[],
|
||||||
GLuint indx[], const GLubyte mask[] )
|
GLuint indx[], const GLubyte mask[] )
|
||||||
{
|
{
|
||||||
@@ -1026,12 +1034,12 @@ MesaSoftRenderer::ReadCI32PixelsBack( const GLcontext *ctx,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftRenderer::ReadRGBAPixelsBack( const GLcontext *ctx,
|
MesaSoftwareRenderer::ReadRGBAPixelsBack( const GLcontext *ctx,
|
||||||
GLuint n, const GLint x[], const GLint y[],
|
GLuint n, const GLint x[], const GLint y[],
|
||||||
GLubyte rgba[][4], const GLubyte mask[] )
|
GLubyte rgba[][4], const GLubyte mask[] )
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
MesaSoftRenderer *mr = (MesaSoftRenderer *) ctx->DriverCtx;
|
MesaSoftwareRenderer *mr = (MesaSoftwareRenderer *) ctx->DriverCtx;
|
||||||
const BBitmap *bitmap = mr->fBitmap;
|
const BBitmap *bitmap = mr->fBitmap;
|
||||||
assert(bitmap);
|
assert(bitmap);
|
||||||
|
|
||||||
+6
-6
@@ -8,8 +8,8 @@
|
|||||||
*
|
*
|
||||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
||||||
*/
|
*/
|
||||||
#ifndef MESARENDERER_H
|
#ifndef MESASOFTWARERENDERER_H
|
||||||
#define MESARENDERER_H
|
#define MESASOFTWARERENDERER_H
|
||||||
|
|
||||||
#include "GLRenderer.h"
|
#include "GLRenderer.h"
|
||||||
|
|
||||||
@@ -19,11 +19,11 @@ extern "C" {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class MesaSoftRenderer : public BGLRenderer
|
class MesaSoftwareRenderer : public BGLRenderer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MesaSoftRenderer(BGLView *view, ulong bgl_options, BGLDispatcher *dispatcher);
|
MesaSoftwareRenderer(BGLView *view, ulong bgl_options, BGLDispatcher *dispatcher);
|
||||||
virtual ~MesaSoftRenderer();
|
virtual ~MesaSoftwareRenderer();
|
||||||
|
|
||||||
virtual void LockGL();
|
virtual void LockGL();
|
||||||
virtual void UnlockGL();
|
virtual void UnlockGL();
|
||||||
@@ -160,5 +160,5 @@ private:
|
|||||||
GLuint fHeight;
|
GLuint fHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MESARENDERER_H
|
#endif // MESASOFTWARERENDERER_H
|
||||||
|
|
||||||
Reference in New Issue
Block a user