return geometry;
}
+Property::Map CreateModelVertexFormat()
+{
+ Property::Map modelVF;
+ modelVF["aPosition"] = Property::VECTOR3;
+ modelVF["aNormal"] = Property::VECTOR3;
+ modelVF["aTexCoord1"] = Property::VECTOR3;
+ modelVF["aTexCoord2"] = Property::VECTOR3;
+ modelVF["aBoneIndex[0]"] = Property::INTEGER;
+ modelVF["aBoneIndex[1]"] = Property::INTEGER;
+ modelVF["aBoneIndex[2]"] = Property::INTEGER;
+ modelVF["aBoneIndex[3]"] = Property::INTEGER;
+ modelVF["aBoneWeights[0]"] = Property::FLOAT;
+ modelVF["aBoneWeights[1]"] = Property::FLOAT;
+ modelVF["aBoneWeights[2]"] = Property::FLOAT;
+ modelVF["aBoneWeights[3]"] = Property::FLOAT;
+ return modelVF;
+}
+
+Geometry CreateModelGeometry(Property::Map& vf)
+{
+ VertexBuffer vertexData = VertexBuffer::New(vf);
+
+ struct Vertex
+ {
+ Vector3 position;
+ Vector3 diffuseTexCoords;
+ Vector3 metalRoughTexCoords;
+ int boneIndices[4];
+ float boneWeights[4];
+ };
+
+ Vertex verts[30];
+ vertexData.SetData(verts, 30);
+ unsigned short indexData[40];
+
+ Geometry geometry = Geometry::New();
+ geometry.AddVertexBuffer(vertexData);
+ geometry.SetIndexBuffer(indexData, sizeof(indexData) / sizeof(indexData[0]));
+
+ return geometry;
+}
+
} // namespace Dali
#define MESH_BUILDER_H
/*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
namespace Dali
{
-Shader CreateShader();
-TextureSet CreateTextureSet();
-TextureSet CreateTextureSet(Texture texture);
-Geometry CreateQuadGeometry();
-VertexBuffer CreateVertexBuffer();
+Shader CreateShader();
+TextureSet CreateTextureSet();
+TextureSet CreateTextureSet(Texture texture);
+Geometry CreateQuadGeometry();
+Geometry CreateModelGeometry(Property::Map& vf);
+VertexBuffer CreateVertexBuffer();
+Property::Map CreateModelVertexFormat();
} // namespace Dali
#include "test-graphics-reflection.h"
#include "test-graphics-sampler.h"
#include "test-graphics-shader.h"
-#include "test-graphics-program.h"
#include "test-graphics-texture.h"
#include <dali/integration-api/gl-defines.h>
bool TestGraphicsController::GetProgramParameter(Graphics::Program& program, uint32_t parameterId, void* outData )
{
mCallStack.PushCall("GetProgramParameter", "");
- return false;
+ auto graphicsProgram = Uncast<TestGraphicsProgram>(&program);
+ return graphicsProgram->GetParameter(parameterId, outData);
}
} // namespace Dali
mCreateInfo(createInfo),
mReflection(gl, vertexFormats)
{
+ mId = 0;//mGl.CreateProgram();
}
+bool TestGraphicsProgram::GetParameter(uint32_t parameterId, void* outData )
+{
+ reinterpret_cast<uint32_t*>(outData)[0] = mId;
+ return true;
+}
+
+
+
} // namespace Dali
return mReflection;
}
+ bool GetParameter(uint32_t parameterId, void* outData );
+
public:
TestGlAbstraction& mGl;
+ uint32_t mId;
Graphics::ProgramCreateInfo mCreateInfo;
TestGraphicsReflection mReflection;
};