1fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt/* 2fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * Copyright 2011 Joakim Sindholt <opensource@zhasha.com> 3fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * 4fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * Permission is hereby granted, free of charge, to any person obtaining a 5fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * copy of this software and associated documentation files (the "Software"), 6fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * to deal in the Software without restriction, including without limitation 7fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * on the rights to use, copy, modify, merge, publish, distribute, sub 8fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * license, and/or sell copies of the Software, and to permit persons to whom 9fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * the Software is furnished to do so, subject to the following conditions: 10fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * 11fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * The above copyright notice and this permission notice (including the next 12fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * paragraph) shall be included in all copies or substantial portions of the 13fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * Software. 14fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * 15fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 18fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, 19fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 21fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt * USE OR OTHER DEALINGS IN THE SOFTWARE. */ 22fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 23fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt#ifndef _NINE_VERTEXBUFFER9_H_ 24fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt#define _NINE_VERTEXBUFFER9_H_ 25fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt#include "resource9.h" 26ea3f504f7caf9900f71a52f1711baf8a50fec490Patrick Rudolph#include "buffer9.h" 27fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 28fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholtstruct pipe_screen; 29fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholtstruct pipe_context; 30fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholtstruct pipe_transfer; 31fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 32fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholtstruct NineVertexBuffer9 33fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt{ 34ea3f504f7caf9900f71a52f1711baf8a50fec490Patrick Rudolph struct NineBuffer9 base; 35fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 36fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt /* G3D */ 37fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt struct pipe_context *pipe; 38fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt D3DVERTEXBUFFER_DESC desc; 39fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt}; 40a2a1a5805fd617e7f3cc8be44dd79b50da07ebb9Ilia Mirkinstatic inline struct NineVertexBuffer9 * 41fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtNineVertexBuffer9( void *data ) 42fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt{ 43fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt return (struct NineVertexBuffer9 *)data; 44fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt} 45fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 46fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtHRESULT 47fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtNineVertexBuffer9_new( struct NineDevice9 *pDevice, 48fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt D3DVERTEXBUFFER_DESC *pDesc, 49fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt struct NineVertexBuffer9 **ppOut ); 50fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 51fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtHRESULT 52fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtNineVertexBuffer9_ctor( struct NineVertexBuffer9 *This, 53fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt struct NineUnknownParams *pParams, 54fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt D3DVERTEXBUFFER_DESC *pDesc ); 55fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 56fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholtvoid 57fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtNineVertexBuffer9_dtor( struct NineVertexBuffer9 *This ); 58ea3f504f7caf9900f71a52f1711baf8a50fec490Patrick Rudolph/*** Nine private ***/ 59ea3f504f7caf9900f71a52f1711baf8a50fec490Patrick Rudolph 60ea3f504f7caf9900f71a52f1711baf8a50fec490Patrick Rudolphstruct pipe_resource * 618960be0e939bc6c0f9f34c5d4a16891af7e325fdAxel DavyNineVertexBuffer9_GetResource( struct NineVertexBuffer9 *This, unsigned *offset ); 62ea3f504f7caf9900f71a52f1711baf8a50fec490Patrick Rudolph 63ea3f504f7caf9900f71a52f1711baf8a50fec490Patrick Rudolph/*** Direct3D public ***/ 64fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 6577d6c11f8fa87ba1070028cb036807dc8a115633Axel DavyHRESULT NINE_WINAPI 66fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtNineVertexBuffer9_Lock( struct NineVertexBuffer9 *This, 67fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt UINT OffsetToLock, 68fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt UINT SizeToLock, 69fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt void **ppbData, 70fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt DWORD Flags ); 71fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 7277d6c11f8fa87ba1070028cb036807dc8a115633Axel DavyHRESULT NINE_WINAPI 73fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtNineVertexBuffer9_Unlock( struct NineVertexBuffer9 *This ); 74fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 7577d6c11f8fa87ba1070028cb036807dc8a115633Axel DavyHRESULT NINE_WINAPI 76fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim SindholtNineVertexBuffer9_GetDesc( struct NineVertexBuffer9 *This, 77fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt D3DVERTEXBUFFER_DESC *pDesc ); 78fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt 79fdd96578ef2dfe9c4ad5aab5858036298d444a64Joakim Sindholt#endif /* _NINE_VERTEXBUFFER9_H_ */ 80