Example #1
0
        /// <summary>
        /// Create a <see cref="ArrayBufferObjectBase"/> for testing.
        /// </summary>
        /// <returns>
        /// It returns the <see cref="ArrayBufferObjectBase"/> instance to test.
        /// </returns>
        private void CreateGpuInstance(BufferObject buffer)
        {
            if (buffer.GetType() == typeof(ArrayBufferObject))
            {
                ArrayBufferObject arrayBufferObject = (ArrayBufferObject)buffer;

                arrayBufferObject.Create(_Context, CreateTestArray());
            }
            else if (buffer.GetType() == typeof(ElementBufferObject))
            {
                ElementBufferObject elementBufferObject = (ElementBufferObject)buffer;

                elementBufferObject.Create(_Context, CreateTestArray());
            }
            else if (buffer.GetType() == typeof(ArrayBufferObjectInterleaved))
            {
                ArrayBufferObjectInterleaved arrayBufferObjectInterleaved = (ArrayBufferObjectInterleaved)buffer;

                arrayBufferObjectInterleaved.Create(_Context, CreateTestArray());
            }
            else if (buffer.GetType() == typeof(ArrayBufferObjectPacked))
            {
                ArrayBufferObjectPacked arrayBufferObjectPacked = (ArrayBufferObjectPacked)buffer;

                arrayBufferObjectPacked.Create(_Context, CreateTestArray());
            }
        }
Example #2
0
            /// <summary>
            /// Allocate an instance of the type.
            /// </summary>
            /// <param name="ctx">
            /// A <see cref="GraphicsContext"/> used for allocating the instance.
            /// </param>
            /// <returns>
            /// It returns an instance of a specific type.
            /// </returns>
            public override object Allocate(GraphicsContext ctx)
            {
                ElementBufferObject arrayBufferObject = new ElementBufferObject(DrawElementsType.UnsignedInt);

                arrayBufferObject.Create(16);

                return(arrayBufferObject);
            }
Example #3
0
            /// <summary>
            /// Allocate an instance of the type mocked for spying.
            /// </summary>
            /// <param name="ctx">
            /// A <see cref="GraphicsContext"/> used for allocating the instance.
            /// </param>
            /// <returns>
            /// It returns an instance of a specific type.
            /// </returns>
            public override T AllocateSpy <T>(GraphicsContext ctx)
            {
                T elementBufferObjectSpy = (T)CreateTypeSpy(_InstanceType, DrawElementsType.UnsignedInt);
                ElementBufferObject elementBufferObject = elementBufferObjectSpy as ElementBufferObject;

                if (elementBufferObject != null)
                {
                    elementBufferObject.Create(16);
                }

                return(elementBufferObjectSpy);
            }
Example #4
0
        /// <summary>
        /// Create a <see cref="ArrayBufferObjectBase"/> for testing.
        /// </summary>
        /// <returns>
        /// It returns the <see cref="ArrayBufferObjectBase"/> instance to test.
        /// </returns>
        private void CreateClientInstance(BufferObject buffer)
        {
            if (buffer.GetType() == typeof(ArrayBufferObject))
            {
                ArrayBufferObject arrayBufferObject = (ArrayBufferObject)buffer;

                arrayBufferObject.Create(CreateTestArray());
            }
            else if (buffer.GetType() == typeof(ElementBufferObject))
            {
                ElementBufferObject elementBufferObject = (ElementBufferObject)buffer;

                elementBufferObject.Create(CreateTestArray());
            }
        }