Changeset 42 for trunk/src


Ignore:
Timestamp:
05/28/13 12:21:27 (12 years ago)
Author:
epyon
Message:
  • vertex_buffer interface and implementation
Location:
trunk/src/gl
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gl/gl_device.cc

    r38 r42  
    77#include "nv/gl/gl_window.hh"
    88#include "nv/gl/gl_program.hh"
     9#include "nv/gl/gl_vertex_buffer.hh"
    910#include "nv/logging.hh"
    1011#include "nv/lib/sdl12.hh"
     
    5051}
    5152
     53vertex_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}
    5257
    5358gl_device::~gl_device()
     
    5560        SDL_Quit();
    5661}
     62
  • trunk/src/gl/gl_enum.cc

    r40 r42  
    123123}
    124124
     125unsigned 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
    125136unsigned int nv::type_to_gl_enum( type type )
    126137{
Note: See TracChangeset for help on using the changeset viewer.