Added LogVisor

This commit is contained in:
Jack Andersen
2015-10-29 20:26:02 -10:00
parent 2814da014f
commit b73ecde4aa
12 changed files with 277 additions and 81 deletions

View File

@@ -5,6 +5,8 @@
namespace boo
{
struct IGraphicsCommandQueue;
struct IGraphicsDataFactory;
class IWindowCallback
{
@@ -146,6 +148,12 @@ public:
TOUCH_TRACKPAD = 2
};
virtual ETouchType getTouchType() const=0;
virtual IGraphicsCommandQueue* getCommandQueue()=0;
virtual IGraphicsDataFactory* getDataFactory()=0;
/* Creates a new context on current thread!! Call from client loading thread */
virtual IGraphicsDataFactory* getLoadContextDataFactory()=0;
};

View File

@@ -5,6 +5,11 @@
namespace boo
{
enum Primitive
{
PrimitiveTriangles,
PrimitiveTriStrips
};
struct IGraphicsCommandQueue
{
@@ -20,11 +25,6 @@ struct IGraphicsCommandQueue
virtual void setClearColor(const float rgba[4])=0;
virtual void clearTarget(bool render=true, bool depth=true)=0;
enum Primitive
{
PrimitiveTriangles,
TrimitiveTriStrips
};
virtual void setDrawPrimitive(Primitive prim)=0;
virtual void draw(size_t start, size_t count)=0;
virtual void drawIndexed(size_t start, size_t count)=0;

View File

@@ -35,6 +35,15 @@ protected:
IGraphicsBufferD() : IGraphicsBuffer(true) {}
};
/** Supported buffer uses */
enum BufferUse
{
BufferUseNull,
BufferUseVertex,
BufferUseIndex,
BufferUseUniform
};
struct ITexture
{
bool dynamic() const {return m_dynamic;}
@@ -61,11 +70,37 @@ protected:
ITextureD() : ITexture(true) {}
};
/** Supported texture formats */
enum TextureFormat
{
TextureFormatRGBA8,
TextureFormatDXT1,
TextureFormatPVRTC4
};
/** Opaque token for representing the data layout of a vertex
* in a VBO. Also able to reference buffers for platforms like
* OpenGL that cache object refs */
struct IVertexFormat {};
/** Types of vertex attributes */
enum VertexSemantic
{
VertexSemanticPosition,
VertexSemanticNormal,
VertexSemanticColor,
VertexSemanticUV,
VertexSemanticWeight
};
/** Used to create IVertexFormat */
struct VertexElementDescriptor
{
const IGraphicsBuffer* vertBuffer = nullptr;
const IGraphicsBuffer* indexBuffer = nullptr;
VertexSemantic semantic;
};
/** Opaque token for referencing a complete graphics pipeline state necessary
* to rasterize geometry (shaders and blending modes mainly) */
struct IShaderPipeline {};
@@ -83,6 +118,21 @@ struct IGraphicsData
virtual ~IGraphicsData() {}
};
/** Used by platform shader pipeline constructors */
enum BlendFactor
{
BlendFactorZero,
BlendFactorOne,
BlendFactorSrcColor,
BlendFactorInvSrcColor,
BlendFactorDstColor,
BlendFactorInvDstColor,
BlendFactorSrcAlpha,
BlendFactorInvSrcAlpha,
BlendFactorDstAlpha,
BlendFactorInvDstAlpha
};
/** Factory object for creating batches of resources as an IGraphicsData token */
struct IGraphicsDataFactory
{
@@ -101,60 +151,20 @@ struct IGraphicsDataFactory
virtual Platform platform() const=0;
virtual const char* platformName() const=0;
enum BufferUse
{
BufferUseNull,
BufferUseVertex,
BufferUseIndex,
BufferUseUniform
};
virtual const IGraphicsBufferS*
newStaticBuffer(BufferUse use, const void* data, size_t sz)=0;
virtual IGraphicsBufferD*
newDynamicBuffer(BufferUse use)=0;
enum TextureFormat
{
TextureFormatRGBA8,
TextureFormatDXT1,
TextureFormatPVRTC4
};
virtual const ITextureS*
newStaticTexture(size_t width, size_t height, size_t mips, TextureFormat fmt,
const void* data, size_t sz)=0;
virtual ITextureD*
newDynamicTexture(size_t width, size_t height, TextureFormat fmt)=0;
struct VertexElementDescriptor
{
const IGraphicsBuffer* vertBuffer = nullptr;
const IGraphicsBuffer* indexBuffer = nullptr;
enum VertexSemantic
{
VertexSemanticPosition,
VertexSemanticNormal,
VertexSemanticColor,
VertexSemanticUV,
VertexSemanticWeight
} semantic;
};
virtual const IVertexFormat*
newVertexFormat(size_t elementCount, const VertexElementDescriptor* elements)=0;
enum BlendFactor
{
BlendFactorZero,
BlendFactorOne,
BlendFactorSrcColor,
BlendFactorInvSrcColor,
BlendFactorDstColor,
BlendFactorInvDstColor,
BlendFactorSrcAlpha,
BlendFactorInvSrcAlpha,
BlendFactorDstAlpha,
BlendFactorInvDstAlpha
};
virtual const IShaderDataBinding*
newShaderDataBinding(const IShaderPipeline* pipeline,
const IVertexFormat* vtxFormat,