Update of /cvsroot/simspark/simspark/spark/kerosin/renderserver
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv11957
Modified Files:
Tag: projectx
renderserver.h
Log Message:
- merged from HEAD
- added methods to deliver Width() and Height() of current view
- added method to copy current view into a buffer
Index: renderserver.h
===================================================================
RCS file: /cvsroot/simspark/simspark/spark/kerosin/renderserver/renderserver.h,v
retrieving revision 1.2.2.2.2.1
retrieving revision 1.2.2.2.2.2
diff -C2 -d -r1.2.2.2.2.1 -r1.2.2.2.2.2
*** renderserver.h 30 Mar 2007 01:57:09 -0000 1.2.2.2.2.1
--- renderserver.h 17 Jun 2007 08:47:51 -0000 1.2.2.2.2.2
***************
*** 40,47 ****
--- 40,49 ----
#include <oxygen/sceneserver/sceneserver.h>
#include <kerosin/openglserver/glbase.h>
+ #include <kerosin/openglserver/openglwrapper.h>
namespace kerosin
{
class OpenGLServer;
+ class RenderNode;
class RenderServer : public BaseRenderServer
***************
*** 51,54 ****
--- 53,59 ----
//
public:
+ typedef std::map<GLuint, boost::weak_ptr<kerosin::RenderNode> > TGLNameMap;
+
+ public:
RenderServer();
virtual ~RenderServer() {}
***************
*** 57,60 ****
--- 62,72 ----
virtual void Render();
+ //! @return the width of the current view
+ virtual int Width() const;
+ //! @return the width of the height view
+ virtual int Height() const;
+ //! Read the current screen content into a buffer
+ bool CopyFrame(char* buffer) const;
+
//! render the scene with fancy lighting
void RenderFancyLighting(const salt::Frustum& frustum,
***************
*** 66,69 ****
--- 78,93 ----
void SetAmbientColor(const RGBA& ambient);
+ /** update variables from a script */
+ virtual void UpdateCached();
+
+ /** If enabled the next render pass is used to pick an object */
+ void EnablePicking(bool enable, const salt::Vector2f& pickAt, const double pickRange);
+
+ /** Disables object picking for the next render pass */
+ void DisablePicking();
+
+ /** Returns the last picked node */
+ boost::weak_ptr<RenderNode> GetPickedNode() const;
+
protected:
/** render a scene recursively.
***************
*** 76,84 ****
--- 100,138 ----
void BindCamera(boost::shared_ptr<oxygen::Camera>& camera);
+ /** clears last intermediate picking state and prepares OpenGL
+ picking
+ */
+ void PreparePicking();
+
+ /** processes the collected picking information */
+ void ProcessPicks();
+
//
// Members
//
protected:
+ /** reference to the SceneServer */
+ CachedPath<oxygen::SceneServer> mSceneServer;
+
+ /** the OpenGL ambient clear color */
RGBA mAmbientColor;
+
+ /** OpenGL name to RenderNode map for object picking */
+ TGLNameMap mNameMap;
+
+ /** counter to assign OpenGL names to RenderNodes while picking */
+ GLuint mNextName;
+
+ /** true, iff picking is enabled */
+ bool mEnablePicking;
+
+ /** the picking position in OpenGL window coordinates */
+ salt::Vector2f mPickAt;
+
+ /** the pick radius around mPickAt */
+ double mPickRange;
+
+ /** the picked result node */
+ boost::weak_ptr<RenderNode> mPickedNode;
};
***************
*** 88,89 ****
--- 142,149 ----
#endif // KEROSIN_RENDERSERVER_H
+
+
+
+
+
+
|