summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets/haiku-softpipe/SoftwareRenderer.h
diff options
context:
space:
mode:
authorAlexander von Gluck IV <[email protected]>2013-10-03 01:22:48 +0000
committerAlexander von Gluck IV <[email protected]>2013-10-04 18:20:09 -0500
commit8730236d1a900c9512a9ef92c08034f0223bcf92 (patch)
tree9d4ec570b0604811cc4431f0e0f5cab292939021 /src/gallium/targets/haiku-softpipe/SoftwareRenderer.h
parentc9f1217e1f2c309cfd8770940773f1f35582a795 (diff)
haiku: Add first Haiku renderer (softpipe)
* This shared library gets parsed by the system as a system "add-on"
Diffstat (limited to 'src/gallium/targets/haiku-softpipe/SoftwareRenderer.h')
-rw-r--r--src/gallium/targets/haiku-softpipe/SoftwareRenderer.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/gallium/targets/haiku-softpipe/SoftwareRenderer.h b/src/gallium/targets/haiku-softpipe/SoftwareRenderer.h
new file mode 100644
index 00000000000..8427ce171fe
--- /dev/null
+++ b/src/gallium/targets/haiku-softpipe/SoftwareRenderer.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2006-2012, Haiku, Inc. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ * Jérôme Duval, [email protected]
+ * Philippe Houdoin, [email protected]
+ * Artur Wyszynski, [email protected]
+ * Alexander von Gluck IV, [email protected]
+ */
+#ifndef SOFTWARERENDERER_H
+#define SOFTWARERENDERER_H
+
+
+#include <kernel/image.h>
+
+#include "GLRenderer.h"
+#include "GalliumContext.h"
+
+
+class SoftwareRenderer : public BGLRenderer {
+public:
+ SoftwareRenderer(BGLView *view,
+ ulong bgl_options,
+ BGLDispatcher *dispatcher);
+ virtual ~SoftwareRenderer();
+
+ virtual void LockGL();
+ virtual void UnlockGL();
+
+ virtual void SwapBuffers(bool vsync = false);
+ virtual void Draw(BRect updateRect);
+ virtual status_t CopyPixelsOut(BPoint source, BBitmap *dest);
+ virtual status_t CopyPixelsIn(BBitmap *source, BPoint dest);
+ virtual void FrameResized(float width, float height);
+
+ virtual void EnableDirectMode(bool enabled);
+ virtual void DirectConnected(direct_buffer_info *info);
+
+private:
+
+ void _AllocateBitmap();
+
+ GalliumContext* fContextObj;
+ BBitmap* fBitmap;
+ context_id fContextID;
+
+ bool fDirectModeEnabled;
+ direct_buffer_info* fInfo;
+ BLocker fInfoLocker;
+ ulong fOptions;
+ GLuint fWidth;
+ GLuint fHeight;
+ GLuint fNewWidth;
+ GLuint fNewHeight;
+ color_space fColorSpace;
+};
+
+#endif // SOFTPIPERENDERER_H