mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 19:44:13 +02:00
adding texture
This commit is contained in:
parent
c4194cd030
commit
5e3e1e4567
2 changed files with 4 additions and 2 deletions
|
@ -37,13 +37,15 @@ PolyLineEntityItem(entityItemID, properties) {
|
||||||
|
|
||||||
gpu::PipelinePointer RenderablePolyLineEntityItem::_pipeline;
|
gpu::PipelinePointer RenderablePolyLineEntityItem::_pipeline;
|
||||||
gpu::Stream::FormatPointer RenderablePolyLineEntityItem::_format;
|
gpu::Stream::FormatPointer RenderablePolyLineEntityItem::_format;
|
||||||
|
gpu::TexturePointer RenderablePolyLineEntityItem::_texture;
|
||||||
|
|
||||||
void RenderablePolyLineEntityItem::createPipeline() {
|
void RenderablePolyLineEntityItem::createPipeline() {
|
||||||
static const int NORMAL_OFFSET = 12;
|
static const int NORMAL_OFFSET = 12;
|
||||||
static const int COLOR_OFFSET = 24;
|
static const int COLOR_OFFSET = 24;
|
||||||
|
|
||||||
auto textureCache = DependencyManager::get<TextureCache>();
|
auto textureCache = DependencyManager::get<TextureCache>();
|
||||||
textureCache->getImageTexture(PathUtils::resourcesPath() + "images/paintStrokeTexture.png");
|
_texture = textureCache->getImageTexture(PathUtils::resourcesPath() + "images/paintStrokeTexture.png");
|
||||||
|
|
||||||
|
|
||||||
_format.reset(new gpu::Stream::Format());
|
_format.reset(new gpu::Stream::Format());
|
||||||
_format->setAttribute(gpu::Stream::POSITION, 0, gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::XYZ), 0);
|
_format->setAttribute(gpu::Stream::POSITION, 0, gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::XYZ), 0);
|
||||||
|
|
|
@ -31,12 +31,12 @@ public:
|
||||||
|
|
||||||
static gpu::PipelinePointer _pipeline;
|
static gpu::PipelinePointer _pipeline;
|
||||||
static gpu::Stream::FormatPointer _format;
|
static gpu::Stream::FormatPointer _format;
|
||||||
|
static gpu::TexturePointer _texture;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void updateGeometry();
|
void updateGeometry();
|
||||||
gpu::BufferPointer _verticesBuffer;
|
gpu::BufferPointer _verticesBuffer;
|
||||||
unsigned int _numVertices;
|
unsigned int _numVertices;
|
||||||
gpu::TexturePointer _texture;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue