4762{
4767 DWORD *adjacency_buf;
4768 unsigned int i,
face;
4770 {
4771 {-0.5f, -0.5f, -0.5f}, {-0.5f, -0.5f, 0.5f}, {-0.5f, 0.5f, 0.5f}, {-0.5f, 0.5f, -0.5f},
4772 {-0.5f, 0.5f, -0.5f}, {-0.5f, 0.5f, 0.5f}, { 0.5f, 0.5f, 0.5f}, { 0.5f, 0.5f, -0.5f},
4773 { 0.5f, 0.5f, -0.5f}, { 0.5f, 0.5f, 0.5f}, { 0.5f, -0.5f, 0.5f}, { 0.5f, -0.5f, -0.5f},
4774 {-0.5f, -0.5f, 0.5f}, {-0.5f, -0.5f, -0.5f}, { 0.5f, -0.5f, -0.5f}, { 0.5f, -0.5f, 0.5f},
4775 {-0.5f, -0.5f, 0.5f}, { 0.5f, -0.5f, 0.5f}, { 0.5f, 0.5f, 0.5f}, {-0.5f, 0.5f, 0.5f},
4776 {-0.5f, -0.5f, -0.5f}, {-0.5f, 0.5f, -0.5f}, { 0.5f, 0.5f, -0.5f}, { 0.5f, -0.5f, -0.5f}
4777 };
4779 {
4780 {-1.0f, 0.0f, 0.0f}, { 0.0f, 1.0f, 0.0f}, { 1.0f, 0.0f, 0.0f},
4781 { 0.0f, -1.0f, 0.0f}, { 0.0f, 0.0f, 1.0f}, { 0.0f, 0.0f, -1.0f}
4782 };
4783 static const DWORD adjacency_table[] =
4784 {
4785 6, 9, 1, 2, 10, 0, 1, 9, 3, 4, 10, 2,
4786 3, 8, 5, 7, 11, 4, 0, 11, 7, 5, 8, 6,
4787 7, 4, 9, 2, 0, 8, 1, 3, 11, 5, 6, 10
4788 };
4789
4790 TRACE(
"device %p, width %f, height %f, depth %f, mesh %p, adjacency %p\n",
4792
4794 {
4796 }
4797
4799 {
4801 }
4802
4803 if (
FAILED(
hr =
box->lpVtbl->LockVertexBuffer(
box, 0, (
void **)&vertices)))
4804 {
4805 box->lpVtbl->Release(
box);
4807 }
4808
4809 if (
FAILED(
hr =
box->lpVtbl->LockIndexBuffer(
box, 0, (
void **)&faces)))
4810 {
4811 box->lpVtbl->UnlockVertexBuffer(
box);
4812 box->lpVtbl->Release(
box);
4814 }
4815
4816 for (
i = 0;
i < 24;
i++)
4817 {
4818 vertices[
i].position.x =
width * unit_box[
i].
x;
4819 vertices[
i].position.y =
height * unit_box[
i].
y;
4820 vertices[
i].position.z =
depth * unit_box[
i].
z;
4821 vertices[
i].normal.x = normals[
i / 4].
x;
4822 vertices[
i].normal.y = normals[
i / 4].
y;
4823 vertices[
i].normal.z = normals[
i / 4].
z;
4824 }
4825
4827 for (
i = 0;
i < 12;
i++)
4828 {
4829 faces[
i][0] =
face++;
4830 faces[
i][1] =
face++;
4832 }
4833
4834 box->lpVtbl->UnlockIndexBuffer(
box);
4835 box->lpVtbl->UnlockVertexBuffer(
box);
4836
4837 if (adjacency)
4838 {
4840 {
4841 box->lpVtbl->Release(
box);
4843 }
4844
4846 memcpy(adjacency_buf, adjacency_table,
sizeof(adjacency_table));
4847 }
4848
4850
4852}
#define D3DERR_INVALIDCALL
HRESULT WINAPI D3DXCreateBuffer(DWORD size, ID3DXBuffer **buffer)
HRESULT WINAPI D3DXCreateMeshFVF(DWORD face_count, DWORD vertex_count, DWORD options, DWORD fvf, struct IDirect3DDevice9 *device, struct ID3DXMesh **mesh)
#define ID3DXBuffer_GetBufferPointer(p)
GLint GLint GLsizei GLsizei GLsizei depth
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLenum GLuint GLint GLenum face
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define memcpy(s1, s2, n)