adding texture

This commit is contained in:
ericrius1 2015-07-17 15:00:10 -07:00
parent c4194cd030
commit 5e3e1e4567
2 changed files with 4 additions and 2 deletions

View file

@ -37,13 +37,15 @@ PolyLineEntityItem(entityItemID, properties) {
gpu::PipelinePointer RenderablePolyLineEntityItem::_pipeline;
gpu::Stream::FormatPointer RenderablePolyLineEntityItem::_format;
gpu::TexturePointer RenderablePolyLineEntityItem::_texture;
void RenderablePolyLineEntityItem::createPipeline() {
static const int NORMAL_OFFSET = 12;
static const int COLOR_OFFSET = 24;
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->setAttribute(gpu::Stream::POSITION, 0, gpu::Element(gpu::VEC3, gpu::FLOAT, gpu::XYZ), 0);

View file

@ -31,12 +31,12 @@ public:
static gpu::PipelinePointer _pipeline;
static gpu::Stream::FormatPointer _format;
static gpu::TexturePointer _texture;
protected:
void updateGeometry();
gpu::BufferPointer _verticesBuffer;
unsigned int _numVertices;
gpu::TexturePointer _texture;
};