- Timestamp:
- 05/28/13 12:21:27 (12 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/gl/gl_device.hh
r38 r42 23 23 virtual window* create_window( uint16 width, uint16 height ); 24 24 virtual program* create_program( const string& vs_source, const string& fs_source ); 25 virtual vertex_buffer* create_vertex_buffer( buffer_hint hint, int size, void* source = nullptr ); 25 26 virtual ~gl_device(); 26 27 private: -
trunk/nv/gl/gl_enum.hh
r35 r42 15 15 #include <nv/interface/clear_state.hh> 16 16 #include <nv/interface/render_state.hh> 17 #include <nv/interface/vertex_buffer.hh> 17 18 #include <nv/types.hh> 18 19 … … 28 29 unsigned int stencil_function_to_enum( stencil_test_face::function_type type ); 29 30 unsigned int stencil_operation_to_enum( stencil_test_face::operation type ); 31 unsigned int buffer_hint_to_enum( buffer_hint hint ); 30 32 31 33 unsigned int type_to_gl_enum( type type ); -
trunk/nv/interface/device.hh
r39 r42 15 15 #include <nv/common.hh> 16 16 #include <nv/string.hh> 17 #include <nv/interface/vertex_buffer.hh> 17 18 18 19 namespace nv … … 26 27 virtual window* create_window( uint16 width, uint16 height ) = 0; 27 28 virtual program* create_program( const string& vs_source, const string& fs_source ) = 0; 29 virtual vertex_buffer* create_vertex_buffer( buffer_hint hint, int size, void* source = nullptr ) = 0; 28 30 }; 29 31 -
trunk/src/gl/gl_device.cc
r38 r42 7 7 #include "nv/gl/gl_window.hh" 8 8 #include "nv/gl/gl_program.hh" 9 #include "nv/gl/gl_vertex_buffer.hh" 9 10 #include "nv/logging.hh" 10 11 #include "nv/lib/sdl12.hh" … … 50 51 } 51 52 53 vertex_buffer* gl_device::create_vertex_buffer( buffer_hint hint, int size, void* source /*= nullptr */ ) 54 { 55 return new gl_vertex_buffer( hint, size, source ); 56 } 52 57 53 58 gl_device::~gl_device() … … 55 60 SDL_Quit(); 56 61 } 62 -
trunk/src/gl/gl_enum.cc
r40 r42 123 123 } 124 124 125 unsigned int nv::buffer_hint_to_enum( buffer_hint hint ) 126 { 127 switch( hint ) 128 { 129 case STATIC_DRAW : return GL_STATIC_DRAW; 130 case STREAM_DRAW : return GL_STREAM_DRAW; 131 case DYNAMIC_DRAW : return GL_DYNAMIC_DRAW; 132 default : return 0; // TODO: throw! 133 } 134 } 135 125 136 unsigned int nv::type_to_gl_enum( type type ) 126 137 {
Note: See TracChangeset
for help on using the changeset viewer.