Inheritance: BaseVertexCache
Example #1
0
		private void Dispose(bool disposing)
		{
			if(this.Disposed == true)
			{
				throw new ObjectDisposedException(this.GetType().Name);
			}

			if(disposing == true)
			{
				this.Bounds = idBounds.Zero;
				this.Indexes = null;
				this.Vertices = null;
				this.ShadowVertices = null;
				this.IndexCache = null;
				this.AmbientCache = null;
			}

			_disposed = true;
		}
Example #2
0
		internal VertexCache AllocateVertexCacheFrameTemporary(Vertex[] vertices)
		{
			VertexCache cache = new VertexCache();

			if(vertices.Length == 0)
			{
				idConsole.Error("AllocateVertexCacheFromTemorary: size = 0");
			}

			// TODO: vertex cache alloc > frameBytes
			/*if(dynamicAllocThisFrame + size > frameBytes)
			{
				// if we don't have enough room in the temp block, allocate a static block,
				// but immediately free it so it will get freed at the next frame
				tempOverflow = true;
				Alloc(data, size, &block);
				Free(block);
				return block;
			}*/

			// this data is just going on the shared dynamic list

			// TODO: i think we could have one massive vertex buffer for temporary frame data.  
			// save having all these creations and destructions of buffers

			// move it from the freeDynamicHeaders list to the dynamicHeaders list
			_dynamicVertexCache.Add(cache);

			// TODO: dynamicAllocThisFrame += block->size;
			// TODO: dynamicCountThisFrame++;

			cache.Tag = VertexCacheType.Temporary;
			cache.Data = vertices;

			return cache;
		}