2015-04-16 16:55:32 +00:00
|
|
|
#ifndef _OPENGL_FONTSTASH_CALLBACKS_H
|
|
|
|
#define _OPENGL_FONTSTASH_CALLBACKS_H
|
|
|
|
|
|
|
|
#include "fontstash.h"
|
|
|
|
struct PrimInternalData;
|
|
|
|
class GLPrimitiveRenderer;
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
struct InternalOpenGL2RenderCallbacks : public RenderCallbacks
|
2015-04-16 16:55:32 +00:00
|
|
|
{
|
2018-09-23 21:17:31 +00:00
|
|
|
virtual PrimInternalData* getData() = 0;
|
2015-04-16 16:55:32 +00:00
|
|
|
|
|
|
|
virtual ~InternalOpenGL2RenderCallbacks();
|
|
|
|
|
|
|
|
virtual void updateTexture(sth_texture* texture, sth_glyph* glyph, int textureWidth, int textureHeight);
|
|
|
|
virtual void render(sth_texture* texture);
|
2018-09-23 21:17:31 +00:00
|
|
|
|
2015-04-16 16:55:32 +00:00
|
|
|
void display2();
|
|
|
|
};
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
void dumpTextureToPng(int screenWidth, int screenHeight, const char* fileName);
|
2015-04-16 16:55:32 +00:00
|
|
|
|
|
|
|
struct SimpleOpenGL2RenderCallbacks : public InternalOpenGL2RenderCallbacks
|
|
|
|
{
|
|
|
|
PrimInternalData* m_data;
|
|
|
|
virtual PrimInternalData* getData()
|
|
|
|
{
|
|
|
|
return m_data;
|
|
|
|
}
|
|
|
|
SimpleOpenGL2RenderCallbacks(PrimInternalData* data)
|
2018-09-23 21:17:31 +00:00
|
|
|
: m_data(data)
|
2015-04-16 16:55:32 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
virtual ~SimpleOpenGL2RenderCallbacks()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
struct OpenGL2RenderCallbacks : public InternalOpenGL2RenderCallbacks
|
2015-04-16 16:55:32 +00:00
|
|
|
{
|
|
|
|
GLPrimitiveRenderer* m_primRender2;
|
|
|
|
virtual PrimInternalData* getData();
|
2018-09-23 21:17:31 +00:00
|
|
|
|
|
|
|
virtual void setWorldPosition(float pos[3]) {}
|
|
|
|
virtual void setWorldOrientation(float orn[4]) {}
|
|
|
|
virtual void setColorRGBA(float color[4]) {}
|
Improve debug text/line rendering, can be use to draw frames and text in local coordinate of an object / link.
example:
kuka = p.loadURDF("kuka_iiwa/model.urdf")
p.getNumJoints(kuka)
pybullet.addUserDebugLine([0,0,0],[0,0,0.1],[0,0,1],trackObjectUniqueId=2,trackLinkIndex=6)
pybullet.addUserDebugText("tip", [0,0,0.1],textColorRGB=[1,0,0],trackObjectUniqueId=2,trackLinkIndex=6)
Also allow to render text using a given orientation (instead of pointing to the camera), example:
pybullet.addUserDebugText("tip", [0,0,0.1],textColorRGB=[1,0,0],textOrientation=[0,0,0,1], trackObjectUniqueId=2,trackLinkIndex=6)
Add drawTexturedTriangleMesh, for drawing 3d text.
Expose readSingleInstanceTransformToCPU, to extract position/orientation from graphics index.
updateTexture: allow to not flip texels around up axis
2017-05-24 05:05:26 +00:00
|
|
|
|
2015-04-16 16:55:32 +00:00
|
|
|
OpenGL2RenderCallbacks(GLPrimitiveRenderer* primRender);
|
|
|
|
virtual ~OpenGL2RenderCallbacks();
|
|
|
|
};
|
|
|
|
|
2018-09-23 21:17:31 +00:00
|
|
|
#endif //_OPENGL_FONTSTASH_CALLBACKS_H
|