Search
lxdream.org :: lxdream/src/display.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/display.h
changeset 1159:580436b01b6c
prev1134:f502f3d32f90
next1239:be3121267597
author nkeynes
date Wed Jan 19 17:50:09 2011 +1000 (9 years ago)
permissions -rw-r--r--
last change Implement vertex array range support, and move buffer operations to gl_vbo.c
file annotate diff log raw
1.1 --- a/src/display.h Fri Oct 22 20:55:32 2010 +1000
1.2 +++ b/src/display.h Wed Jan 19 17:50:09 2011 +1000
1.3 @@ -108,6 +108,43 @@
1.4 int stencil_bits; /* 0 = no stencil buffer */
1.5 };
1.6
1.7 +struct vertex_buffer {
1.8 + /**
1.9 + * Map the buffer into the host address space (if necessary) in preparation
1.10 + * for filling the buffer. This also implies a fence operation.
1.11 + * @param buf previously allocated buffer
1.12 + * @param size number of bytes of the buffer actually to be used. The buffer
1.13 + * will be resized if necessary.
1.14 + * @return a pointer to the start of the buffer.
1.15 + */
1.16 + void *(*map)(vertex_buffer_t buf, uint32_t size);
1.17 +
1.18 + /**
1.19 + * Unmap the buffer, after the vertex data is written.
1.20 + * @return the buffer base to use for gl*Pointer calls
1.21 + */
1.22 + void *(*unmap)(vertex_buffer_t buf);
1.23 +
1.24 + /**
1.25 + * Mark the buffer as finished, indicating that the vertex data is no
1.26 + * longer required (ie rendering is complete).
1.27 + */
1.28 + void (*finished)(vertex_buffer_t buf);
1.29 +
1.30 + /**
1.31 + * Delete the buffer and all associated resources.
1.32 + */
1.33 + void (*destroy)(vertex_buffer_t buf);
1.34 +
1.35 + /* Private data */
1.36 + void *data;
1.37 + GLuint id;
1.38 + uint32_t capacity;
1.39 + uint32_t mapped_size;
1.40 + GLuint fence;
1.41 +};
1.42 +
1.43 +
1.44 /**
1.45 * Core video driver - exports function to setup a GL context, as well as handle
1.46 * keyboard input and display resultant output.
1.47 @@ -213,11 +250,17 @@
1.48 int rowstride, int format );
1.49
1.50 /**
1.51 + * Create a new vertex buffer
1.52 + */
1.53 + vertex_buffer_t (*create_vertex_buffer)( );
1.54 +
1.55 + /**
1.56 * Dump driver-specific information about the implementation to the given stream
1.57 */
1.58 void (*print_info)( FILE *out );
1.59
1.60 struct display_capabilities capabilities;
1.61 +
1.62 } *display_driver_t;
1.63
1.64 /**
.