summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
Diffstat (limited to 'o3d')
-rw-r--r--o3d/converter/cross/primitive_stub.h15
-rw-r--r--o3d/core/cross/command_buffer/primitive_cb.cc34
-rw-r--r--o3d/core/cross/command_buffer/primitive_cb.h15
-rw-r--r--o3d/core/cross/gl/primitive_gl.cc33
-rw-r--r--o3d/core/cross/gl/primitive_gl.h15
-rw-r--r--o3d/core/cross/primitive.cc44
-rw-r--r--o3d/core/cross/primitive.h16
-rw-r--r--o3d/core/cross/stream_bank.cc59
-rw-r--r--o3d/core/cross/stream_bank.h48
-rw-r--r--o3d/core/cross/stream_bank_test.cc33
-rw-r--r--o3d/core/win/d3d9/primitive_d3d9.cc24
-rw-r--r--o3d/core/win/d3d9/primitive_d3d9.h15
-rw-r--r--o3d/plugin/idl/stream_bank.idl25
13 files changed, 179 insertions, 197 deletions
diff --git a/o3d/converter/cross/primitive_stub.h b/o3d/converter/cross/primitive_stub.h
index 81b4808..b17bec0 100644
--- a/o3d/converter/cross/primitive_stub.h
+++ b/o3d/converter/cross/primitive_stub.h
@@ -54,14 +54,13 @@ class PrimitiveStub : public Primitive {
: Primitive(service_locator) {}
virtual ~PrimitiveStub() {}
- // Overridden from Element
- // Renders this Element using the parameters from override first, followed by
- // the draw_element, followed by params on this Primitive and material.
- virtual void Render(Renderer* renderer,
- DrawElement* draw_element,
- Material* material,
- ParamObject* override,
- ParamCache* param_cache) {}
+ protected:
+ // Overridden from Primitive.
+ virtual void PlatformSpecificRender(Renderer* renderer,
+ DrawElement* draw_element,
+ Material* material,
+ ParamObject* override,
+ ParamCache* param_cache) {}
private:
DISALLOW_COPY_AND_ASSIGN(PrimitiveStub);
diff --git a/o3d/core/cross/command_buffer/primitive_cb.cc b/o3d/core/cross/command_buffer/primitive_cb.cc
index 95d4dc5..2f02dba 100644
--- a/o3d/core/cross/command_buffer/primitive_cb.cc
+++ b/o3d/core/cross/command_buffer/primitive_cb.cc
@@ -83,35 +83,19 @@ static GAPIInterface::PrimitiveType GetCBPrimitiveType(
}
// Sends the draw commands to the command buffers.
-void PrimitiveCB::Render(Renderer* renderer,
- DrawElement* draw_element,
- Material* material,
- ParamObject* override,
- ParamCache* param_cache) {
+void PrimitiveCB::PlatformSpecificRender(Renderer* renderer,
+ DrawElement* draw_element,
+ Material* material,
+ ParamObject* override,
+ ParamCache* param_cache) {
DLOG_ASSERT(draw_element);
DLOG_ASSERT(param_cache);
- if (!material) {
- O3D_ERROR(service_locator())
- << "No Material attached to Shape '"
- << draw_element->name() << "'";
- return;
- }
+ DLOG_ASSERT(material);
+
EffectCB *effect_cb = down_cast<EffectCB*>(material->effect());
- // If there's no effect attached to this Material, draw nothing.
- if (!effect_cb ||
- effect_cb->resource_id() == command_buffer::kInvalidResource) {
- O3D_ERROR(service_locator())
- << "No Effect attached to Material '"
- << material->name() << "' in Shape '"
- << draw_element->name() << "'";
- return;
- }
+ DLOG_ASSERT(effect_cb);
StreamBankCB* stream_bank_cb = down_cast<StreamBankCB*>(stream_bank());
- if (!stream_bank_cb) {
- O3D_ERROR(service_locator())
- << "No StreamBank attached to Shape '"
- << draw_element->name() << "'";
- }
+ DLOG_ASSERT(stream_bank_cb);
ParamCacheCB *param_cache_cb = down_cast<ParamCacheCB *>(param_cache);
diff --git a/o3d/core/cross/command_buffer/primitive_cb.h b/o3d/core/cross/command_buffer/primitive_cb.h
index 851258e..a8a9a04 100644
--- a/o3d/core/cross/command_buffer/primitive_cb.h
+++ b/o3d/core/cross/command_buffer/primitive_cb.h
@@ -51,14 +51,13 @@ class PrimitiveCB : public Primitive {
PrimitiveCB(ServiceLocator* service_locator, RendererCB *renderer);
virtual ~PrimitiveCB();
- // Overridden from Element
- // Renders this Element using the parameters from override first, followed by
- // the draw_element, followed by params on this Primitive and material.
- virtual void Render(Renderer* renderer,
- DrawElement* draw_element,
- Material* material,
- ParamObject* override,
- ParamCache* param_cache);
+ protected:
+ // Overridden from Primitve.
+ virtual void PlatformSpecificRender(Renderer* renderer,
+ DrawElement* draw_element,
+ Material* material,
+ ParamObject* override,
+ ParamCache* param_cache);
private:
// The renderer that created this shape data.
RendererCB *renderer_;
diff --git a/o3d/core/cross/gl/primitive_gl.cc b/o3d/core/cross/gl/primitive_gl.cc
index 8207792..faf57b2 100644
--- a/o3d/core/cross/gl/primitive_gl.cc
+++ b/o3d/core/cross/gl/primitive_gl.cc
@@ -72,38 +72,21 @@ PrimitiveGL::~PrimitiveGL() {
// was called (or it's the first time it's getting called) then it forces
// an update of the mapping between the Shape Param's and the shader parameters
// and also fills in for any missing streams.
-void PrimitiveGL::Render(Renderer* renderer,
- DrawElement* draw_element,
- Material* material,
- ParamObject* override,
- ParamCache* param_cache) {
+void PrimitiveGL::PlatformSpecificRender(Renderer* renderer,
+ DrawElement* draw_element,
+ Material* material,
+ ParamObject* override,
+ ParamCache* param_cache) {
+ DLOG_ASSERT(material);
DLOG_ASSERT(draw_element);
DLOG_ASSERT(param_cache);
DLOG_FIRST_N(INFO, kNumLoggedEvents) << "PrimitiveGL Draw \""
<< draw_element->name() << "\"";
- // If there's no material attached to this Shape.
- if (!material) {
- O3D_ERROR(service_locator()) << "No Material attached to Shape \""
- << draw_element->name() << "\"";
- return;
- }
DrawElementGL* draw_element_gl = down_cast<DrawElementGL*>(draw_element);
EffectGL* effect_gl = down_cast<EffectGL*>(material->effect());
- // If there's no effect attached to this Material.
- if (!effect_gl) {
- O3D_ERROR(service_locator()) << "No Effect attached to Material '"
- << material->name() << "' in Shape '"
- << draw_element_gl->name() << "'";
- return;
- }
+ DLOG_ASSERT(effect_gl);
StreamBankGL* stream_bank_gl = down_cast<StreamBankGL*>(stream_bank());
- if (!stream_bank_gl) {
- O3D_ERROR(service_locator())
- << "No StreambBank attached to Primitive '"
- << material->name() << "' in Shape '"
- << draw_element_gl->name() << "'";
- return;
- }
+ DLOG_ASSERT(stream_bank_gl);
ParamCacheGL* param_cache_gl = down_cast<ParamCacheGL*>(param_cache);
ParamCacheGL::VaryingParameterMap& varying_map =
diff --git a/o3d/core/cross/gl/primitive_gl.h b/o3d/core/cross/gl/primitive_gl.h
index f484bf9..dbea9c6 100644
--- a/o3d/core/cross/gl/primitive_gl.h
+++ b/o3d/core/cross/gl/primitive_gl.h
@@ -49,14 +49,13 @@ class PrimitiveGL : public Primitive {
explicit PrimitiveGL(ServiceLocator* service_locator);
virtual ~PrimitiveGL();
- // Overridden from Element
- // Renders this Element using the parameters from override first, followed by
- // the draw_element, followed by params on this Primitive and material.
- virtual void Render(Renderer* renderer,
- DrawElement* draw_element,
- Material* material,
- ParamObject* override,
- ParamCache* param_cache);
+ protected:
+ // Overridden from Primitive.
+ virtual void PlatformSpecificRender(Renderer* renderer,
+ DrawElement* draw_element,
+ Material* material,
+ ParamObject* override,
+ ParamCache* param_cache);
private:
};
diff --git a/o3d/core/cross/primitive.cc b/o3d/core/cross/primitive.cc
index 19ccfa1..b47015a 100644
--- a/o3d/core/cross/primitive.cc
+++ b/o3d/core/cross/primitive.cc
@@ -36,7 +36,7 @@
#include "core/cross/primitive.h"
#include "core/cross/renderer.h"
#include "core/cross/error.h"
-#include "core/cross/vertex_source.h"
+#include "core/cross/stream_bank.h"
namespace o3d {
@@ -94,6 +94,48 @@ Primitive::Primitive(ServiceLocator* service_locator)
Primitive::~Primitive() {
}
+void Primitive::Render(Renderer* renderer,
+ DrawElement* draw_element,
+ Material* material,
+ ParamObject* override,
+ ParamCache* param_cache) {
+ DLOG_ASSERT(draw_element);
+ DLOG_ASSERT(param_cache);
+ // If there's no material attached to this Shape.
+ if (!material) {
+ O3D_ERROR(service_locator()) << "No Material attached to Shape \""
+ << draw_element->name() << "\"";
+ return;
+ }
+
+ Effect* effect = material->effect();
+ if (!effect) {
+ O3D_ERROR(service_locator()) << "No Effect attached to Material '"
+ << material->name() << "' in Shape '"
+ << draw_element->name() << "'";
+ return;
+ }
+
+ StreamBank* bank = stream_bank();
+ if (!bank) {
+ O3D_ERROR(service_locator())
+ << "No StreambBank attached to Primitive '"
+ << material->name() << "' in Shape '"
+ << draw_element->name() << "'";
+ return;
+ }
+
+ if (!bank->renderable()) {
+ O3D_ERROR(service_locator())
+ << "StreamBank has non-renderable buffers '"
+ << bank->name() << "'";
+ return;
+ }
+
+ PlatformSpecificRender(renderer, draw_element, material, override,
+ param_cache);
+}
+
namespace {
// A class to make it easy to access floats from a buffer given a stream.
diff --git a/o3d/core/cross/primitive.h b/o3d/core/cross/primitive.h
index 29853d6..6941657 100644
--- a/o3d/core/cross/primitive.h
+++ b/o3d/core/cross/primitive.h
@@ -145,11 +145,11 @@ class Primitive : public Element {
}
// Render this Primitive.
- virtual void Render(Renderer* renderer,
- DrawElement* draw_element,
- Material* material,
- ParamObject* param_object,
- ParamCache* param_cache) = 0;
+ void Render(Renderer* renderer,
+ DrawElement* draw_element,
+ Material* material,
+ ParamObject* param_object,
+ ParamCache* param_cache);
// Overridden from Element (see element.h)
// Computes the intersection of a ray in the same coordinate system as
@@ -190,6 +190,12 @@ class Primitive : public Element {
protected:
explicit Primitive(ServiceLocator* service_locator);
+ virtual void PlatformSpecificRender(Renderer* renderer,
+ DrawElement* draw_element,
+ Material* material,
+ ParamObject* param_object,
+ ParamCache* param_cache) = 0;
+
PrimitiveType primitive_type_;
unsigned int number_vertices_;
unsigned int number_primitives_;
diff --git a/o3d/core/cross/stream_bank.cc b/o3d/core/cross/stream_bank.cc
index 65f6b73..e671693 100644
--- a/o3d/core/cross/stream_bank.cc
+++ b/o3d/core/cross/stream_bank.cc
@@ -40,7 +40,7 @@
namespace o3d {
-O3D_DEFN_CLASS(StreamBank, NamedObject);
+O3D_DEFN_CLASS(StreamBank, VertexSource);
O3D_DEFN_CLASS(ParamStreamBank, RefParamBase);
ObjectBase::Ref StreamBank::Create(ServiceLocator* service_locator) {
@@ -54,9 +54,10 @@ ObjectBase::Ref StreamBank::Create(ServiceLocator* service_locator) {
}
StreamBank::StreamBank(ServiceLocator* service_locator)
- : NamedObject(service_locator),
+ : VertexSource(service_locator),
number_binds_(0),
change_count_(1),
+ renderable_(true),
weak_pointer_manager_(this) {
}
@@ -75,6 +76,21 @@ unsigned StreamBank::GetMaxVertices() const {
return max_vertices;
}
+void StreamBank::UpdateRenderable() {
+ StreamParamVector::const_iterator stream_iter;
+ for (stream_iter = vertex_stream_params_.begin();
+ stream_iter != vertex_stream_params_.end();
+ ++stream_iter) {
+ const Stream& stream = (*stream_iter)->stream();
+ Buffer* buffer = stream.field().buffer();
+ if (!buffer || !buffer->IsA(VertexBuffer::GetApparentClass())) {
+ renderable_ = false;
+ return;
+ }
+ }
+ renderable_ = true;
+}
+
// Adds a new vertex Stream to the StreamBank. If a Stream with the same
// semantic is already bound to the StreamBank then it removes it before adding
// the new one. Otherwise, it creates a new stream with the information supplied
@@ -90,13 +106,6 @@ bool StreamBank::SetVertexStream(Stream::Semantic stream_semantic,
return false;
}
- // Check that this buffer is renderable. StreamBanks are used to submit
- // data to GPU so we can only allow GPU accessible buffers through here.
- if (!buffer->IsA(VertexBuffer::GetApparentClass())) {
- O3D_ERROR(service_locator()) << "Buffer is not a VertexBuffer";
- return false;
- }
-
++change_count_;
Stream::Ref stream(new Stream(service_locator(),
@@ -112,6 +121,7 @@ bool StreamBank::SetVertexStream(Stream::Semantic stream_semantic,
new SlaveParamVertexBufferStream(service_locator(), this, stream));
vertex_stream_params_.push_back(stream_param);
+ UpdateRenderable();
OnUpdateStreams();
return true;
@@ -150,6 +160,7 @@ bool StreamBank::RemoveVertexStream(Stream::Semantic stream_semantic,
stream.semantic_index() == semantic_index) {
++change_count_;
vertex_stream_params_.erase(iter);
+ UpdateRenderable();
OnUpdateStreams();
return true;
}
@@ -157,36 +168,6 @@ bool StreamBank::RemoveVertexStream(Stream::Semantic stream_semantic,
return false;
}
-bool StreamBank::BindStream(VertexSource* source,
- Stream::Semantic semantic,
- int semantic_index) {
- if (source) {
- ParamVertexBufferStream* source_param = source->GetVertexStreamParam(
- semantic, semantic_index);
- ParamVertexBufferStream* dest_param = GetVertexStreamParam(
- semantic, semantic_index);
- if (source_param && dest_param &&
- source_param->stream().field().IsA(
- dest_param->stream().field().GetClass()) &&
- source_param->stream().field().num_components() ==
- dest_param->stream().field().num_components()) {
- return dest_param->Bind(source_param);
- }
- }
-
- return false;
-}
-
-bool StreamBank::UnbindStream(Stream::Semantic semantic, int semantic_index) {
- ParamVertexBufferStream* dest_param = GetVertexStreamParam(
- semantic, semantic_index);
- if (dest_param && dest_param->input_connection() != NULL) {
- dest_param->UnbindInput();
- return true;
- }
- return false;
-}
-
void StreamBank::UpdateStreams() {
if (number_binds_) {
// TODO: Although a second call to UpdateStream on these streams
diff --git a/o3d/core/cross/stream_bank.h b/o3d/core/cross/stream_bank.h
index 4d9af76..1c62d7d 100644
--- a/o3d/core/cross/stream_bank.h
+++ b/o3d/core/cross/stream_bank.h
@@ -39,14 +39,13 @@
#include <map>
#include "core/cross/element.h"
#include "core/cross/stream.h"
+#include "core/cross/vertex_source.h"
namespace o3d {
-class VertexSource;
-
// A StreamBank collects streams so they can be shared amoung StreamBanks. It
// also handles platform specific things like vertex declarations..
-class StreamBank : public NamedObject {
+class StreamBank : public VertexSource {
public:
typedef SmartPointer<StreamBank> Ref;
typedef WeakPointer<StreamBank> WeakPointerType;
@@ -55,10 +54,15 @@ class StreamBank : public NamedObject {
// The number of times streams have been added or removed from this stream
// bank. Can be used for caching.
- int change_count() {
+ int change_count() const {
return change_count_;
}
+ // True if all the streams on this streambank are renderable.
+ bool renderable() const {
+ return renderable_;
+ }
+
// Binds a field of a vertex buffer to the streambank and defines how the data
// in the buffer should be accessed and interpreted. The buffer of the field
// must be of a compatible type otherwise the binding fails and the function
@@ -82,37 +86,15 @@ class StreamBank : public NamedObject {
// set on this StreamBank.
unsigned GetMaxVertices() const;
- // Used by BindStream.
- // Returns the ParamVertexBufferStream that manages the given stream.
- // as an output param for this VertexSource.
- ParamVertexBufferStream* GetVertexStreamParam(Stream::Semantic semantic,
- int semantic_index) const;
+ // Overriden from VertexSource.
+ virtual ParamVertexBufferStream* GetVertexStreamParam(
+ Stream::Semantic semantic,
+ int semantic_index) const;
const StreamParamVector& vertex_stream_params() const {
return vertex_stream_params_;
}
- // Bind the source stream to the corresponding stream in this VertexSource.
- // Parameters:
- // source: Source to get vertices from.
- // semantic: The semantic of the vertices to get
- // semantic_index: The semantic index of the vertices to get.
- // Returns:
- // True if success. False if failure. If the requested semantic or semantic
- // index do not exist on the source or this source the bind will fail. If
- // they do exist but are not the same length the bind will fail.
- bool BindStream(VertexSource* source,
- Stream::Semantic semantic,
- int semantic_index);
-
- // Unbinds the requested stream.
- // Parameters:
- // semantic: The semantic of the vertices to unbind
- // semantic_index: The semantic index of the vertices to unbind.
- // Returns:
- // True if unbound. False those vertices do not exist or were not bound.
- bool UnbindStream(Stream::Semantic semantic, int semantic_index);
-
// If the streams are bound to other streams, update them.
void UpdateStreams();
@@ -162,6 +144,9 @@ class StreamBank : public NamedObject {
friend class IClassManager;
static ObjectBase::Ref Create(ServiceLocator* service_locator);
+ // Updates the renderable flag.
+ void UpdateRenderable();
+
// the number of streams that are bound to a VertexSource.
// Used as a shortcut. If zero no need to do expensive checking.
unsigned int number_binds_;
@@ -169,6 +154,9 @@ class StreamBank : public NamedObject {
// The number of times a stream has been added or removed.
int change_count_;
+ // True if all the streams on this streambank are renderable.
+ bool renderable_;
+
// Manager for weak pointers to us.
WeakPointerType::WeakPointerManager weak_pointer_manager_;
diff --git a/o3d/core/cross/stream_bank_test.cc b/o3d/core/cross/stream_bank_test.cc
index b8bf67b..2c962f9 100644
--- a/o3d/core/cross/stream_bank_test.cc
+++ b/o3d/core/cross/stream_bank_test.cc
@@ -130,6 +130,9 @@ TEST_F(StreamBankTest, Basic) {
StreamBank* stream_bank = pack()->Create<StreamBank>();
// Check that StreamBank got created.
ASSERT_TRUE(stream_bank != NULL);
+ EXPECT_TRUE(stream_bank->IsA(StreamBank::GetApparentClass()));
+ EXPECT_TRUE(stream_bank->IsA(VertexSource::GetApparentClass()));
+ EXPECT_TRUE(stream_bank->renderable());
// Check Setting Vertex Streams.
VertexBuffer* vertex_buffer = pack()->Create<VertexBuffer>();
@@ -160,6 +163,36 @@ TEST_F(StreamBankTest, Basic) {
EXPECT_FALSE(stream_bank->RemoveVertexStream(Stream::POSITION, 0));
}
+TEST_F(StreamBankTest, Renderable) {
+ StreamBank* stream_bank = pack()->Create<StreamBank>();
+ ASSERT_TRUE(stream_bank != NULL);
+
+ VertexBuffer* vertex_buffer = pack()->Create<VertexBuffer>();
+ ASSERT_TRUE(vertex_buffer != NULL);
+ SourceBuffer* source_buffer = pack()->Create<SourceBuffer>();
+ ASSERT_TRUE(source_buffer != NULL);
+
+ Field* field1 = vertex_buffer->CreateField(FloatField::GetApparentClass(), 1);
+ Field* field2 = source_buffer->CreateField(FloatField::GetApparentClass(), 1);
+ ASSERT_TRUE(field1 != NULL);
+ ASSERT_TRUE(field2 != NULL);
+
+ EXPECT_TRUE(stream_bank->SetVertexStream(Stream::POSITION, 0, field1, 0));
+ EXPECT_TRUE(stream_bank->renderable());
+ EXPECT_TRUE(stream_bank->SetVertexStream(Stream::POSITION, 1, field2, 0));
+ EXPECT_FALSE(stream_bank->renderable());
+ EXPECT_TRUE(stream_bank->RemoveVertexStream(Stream::POSITION, 1));
+ EXPECT_TRUE(stream_bank->renderable());
+ EXPECT_TRUE(stream_bank->SetVertexStream(Stream::POSITION, 0, field2, 0));
+ EXPECT_FALSE(stream_bank->renderable());
+ EXPECT_TRUE(stream_bank->SetVertexStream(Stream::POSITION, 0, field1, 0));
+ EXPECT_TRUE(stream_bank->renderable());
+ EXPECT_FALSE(stream_bank->RemoveVertexStream(Stream::POSITION, 1));
+ EXPECT_FALSE(stream_bank->RemoveVertexStream(Stream::BINORMAL, 0));
+ EXPECT_TRUE(stream_bank->RemoveVertexStream(Stream::POSITION, 0));
+ EXPECT_FALSE(stream_bank->RemoveVertexStream(Stream::POSITION, 0));
+}
+
TEST_F(StreamBankTest, BindStream) {
static float some_vertices[][3] = {
{ 1.0f, 2.0f, 3.0f, },
diff --git a/o3d/core/win/d3d9/primitive_d3d9.cc b/o3d/core/win/d3d9/primitive_d3d9.cc
index 5d0a026..a9492c7 100644
--- a/o3d/core/win/d3d9/primitive_d3d9.cc
+++ b/o3d/core/win/d3d9/primitive_d3d9.cc
@@ -70,12 +70,13 @@ PrimitiveD3D9::~PrimitiveD3D9() {
// was called (or it's the first time it's getting called) then it forces
// an update of the mapping between the Material's Params and the shader
// parameters and also fills in for any missing streams.
-void PrimitiveD3D9::Render(Renderer* renderer,
- DrawElement* draw_element,
- Material* material,
- ParamObject* override,
- ParamCache* param_cache) {
+void PrimitiveD3D9::PlatformSpecificRender(Renderer* renderer,
+ DrawElement* draw_element,
+ Material* material,
+ ParamObject* override,
+ ParamCache* param_cache) {
DLOG_ASSERT(param_cache != NULL);
+ DLOG_ASSERT(material != NULL);
ParamCacheD3D9* param_cache_d3d9 = down_cast<ParamCacheD3D9*>(param_cache);
if (!material) {
@@ -85,18 +86,9 @@ void PrimitiveD3D9::Render(Renderer* renderer,
}
EffectD3D9* effect_d3d9 = down_cast<EffectD3D9*>(material->effect());
- if (!effect_d3d9) {
- O3D_ERROR(service_locator())
- << "No effect on material '" << material->name() << "'";
- return;
- }
-
+ DLOG_ASSERT(effect_d3d9);
StreamBankD3D9* stream_bank_d3d9 = down_cast<StreamBankD3D9*>(stream_bank());
- if (!stream_bank_d3d9) {
- O3D_ERROR(service_locator())
- << "No stream bank on Primitive '" << name() << "'";
- return;
- }
+ DLOG_ASSERT(stream_bank_d3d9);
DrawElementD3D9* draw_element_d3d9 = down_cast<DrawElementD3D9*>(
draw_element);
diff --git a/o3d/core/win/d3d9/primitive_d3d9.h b/o3d/core/win/d3d9/primitive_d3d9.h
index 2c03178..7a97d84 100644
--- a/o3d/core/win/d3d9/primitive_d3d9.h
+++ b/o3d/core/win/d3d9/primitive_d3d9.h
@@ -50,14 +50,13 @@ class PrimitiveD3D9 : public Primitive {
IDirect3DDevice9* d3d_device);
~PrimitiveD3D9();
- // Overridden from Primitive Render this Primitive using the parameters from
- // override first, followed by the draw_element, followed by params on this
- // Primitive and material.
- virtual void Render(Renderer* renderer,
- DrawElement* draw_element,
- Material* material,
- ParamObject* override,
- ParamCache* param_cache);
+ protected:
+ // Overridden from Primitive.
+ virtual void PlatformSpecificRender(Renderer* renderer,
+ DrawElement* draw_element,
+ Material* material,
+ ParamObject* override,
+ ParamCache* param_cache);
private:
CComPtr<IDirect3DDevice9> d3d_device_;
diff --git a/o3d/plugin/idl/stream_bank.idl b/o3d/plugin/idl/stream_bank.idl
index a5f08d9..45e7179 100644
--- a/o3d/plugin/idl/stream_bank.idl
+++ b/o3d/plugin/idl/stream_bank.idl
@@ -35,7 +35,7 @@ namespace o3d {
The StreamBank a collection of streams that hold vertices.
%]
[nocpp, include="core/cross/primitive.h"]
-class StreamBank : NamedObject {
+class StreamBank : VertexSource {
%[
Binds a VertexBuffer field to the StreamBank and defines how the data in
@@ -71,29 +71,6 @@ class StreamBank : NamedObject {
bool RemoveVertexStream(Stream::Semantic semantic, int semantic_index);
%[
- Binds the source stream to the corresponding stream in this VertexSource.
-
- \param source Source to get vertices from.
- \param semantic The semantic of the vertices to get
- \param semantic_index The semantic index of the vertices to get.
- \return True if success. False if failure. If the requested semantic or
- semantic index do not exist on the source or this source the bind will
- fail.
- %]
- bool BindStream(VertexSource source,
- Stream::Semantic semantic,
- int semantic_index);
-
- %[
- Unbinds the requested stream.
- \param semantic The semantic of the vertices to unbind
- \param semantic_index The semantic index of the vertices to unbind.
- \return True if unbound. False those vertices do not exist or were not
- bound.
- %]
- bool UnbindStream(Stream::Semantic semantic, int semantic_index);
-
- %[
An array of the vertex streams on this StreamBank.
Each access to this field gets the entire list so it is best to get it