Ignore:
Timestamp:
06/20/15 00:05:17 (10 years ago)
Author:
epyon
Message:
  • code compiles cleanly on maximum warning level
File:
1 edited

Legend:

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

    r403 r406  
    9191        // TODO: support GL_READ_FRAMEBUFFER?
    9292        const gl_framebuffer_info* info  = m_framebuffers.get( f );
    93         const gl_texture_info*     tinfo = (gl_texture_info*)m_device->get_texture_info( t );
     93        const gl_texture_info*     tinfo = static_cast< const gl_texture_info* >( m_device->get_texture_info( t ) );
    9494        if ( info )
    9595        {
     
    101101                        //              if ( tinfo->size.y == 0 )
    102102                                //                      glFramebufferTexture1D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+(unsigned)slot, GL_TEXTURE_1D, tinfo->glid, 0 );
    103                         glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+(unsigned)slot, gl_type, tinfo->glid, 0 );
     103                        glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+unsigned( slot ), gl_type, tinfo->glid, 0 );
    104104                }
    105105                else
    106106                {
    107                         glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+(unsigned)slot, gl_type, 0, 0 );
     107                        glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+unsigned( slot ), gl_type, 0, 0 );
    108108                }
    109109
     
    116116        // TODO: support GL_READ_FRAMEBUFFER?
    117117        const gl_framebuffer_info* info  = m_framebuffers.get( f );
    118         const gl_texture_info*     tinfo = (gl_texture_info*)m_device->get_texture_info( depth );
     118        const gl_texture_info*     tinfo = static_cast< const gl_texture_info* >( m_device->get_texture_info( depth ) );
    119119        if ( info )
    120120        {
     
    213213void nv::gl_context::bind( program p )
    214214{
    215         gl_program_info* info = ((gl_device*)m_device)->m_programs.get( p );
     215        gl_device* gdevice    = static_cast<gl_device*>( m_device );
     216        gl_program_info* info = gdevice->m_programs.get( p );
    216217        if ( info )
    217218        {
    218219                glUseProgram( info->glid );
    219                 ((gl_device*)m_device)->update_uniforms( info );
     220                gdevice->update_uniforms( info );
    220221        }
    221222}
     
    248249                        }
    249250
    250                         glVertexAttribPointer( 
    251                                 location, 
    252                                 static_cast<GLint>( vba.components ), 
     251                        glVertexAttribPointer(
     252                                location,
     253                                static_cast<GLint>( vba.components ),
    253254                                nv::datatype_to_gl_enum( vba.dtype ),
    254255                                GL_FALSE,
    255256                                static_cast<GLsizei>( vba.stride ),
    256                                 (void*)vba.offset
     257                                reinterpret_cast<void*>( vba.offset )
    257258                                );
    258259                }
     
    317318}
    318319
    319 void nv::gl_context::update( texture t, void* data )
     320void nv::gl_context::update( texture t, const void* data )
    320321{
    321322        const gl_texture_info* info = static_cast< const gl_texture_info* >( m_device->get_texture_info( t ) );
     
    327328
    328329                glBindTexture( gl_type, info->glid );
    329                 glTexImage2D( gl_type, 0, (GLint)nv::image_format_to_internal_enum(format.format), size.x, size.y, 0, nv::image_format_to_enum(format.format), nv::datatype_to_gl_enum(format.type), data );
     330                glTexImage2D( gl_type, 0, static_cast<GLint>( nv::image_format_to_internal_enum(format.format) ), size.x, size.y, 0, nv::image_format_to_enum(format.format), nv::datatype_to_gl_enum(format.type), data );
    330331        }
    331332}
     
    338339                GLenum glenum = buffer_type_to_enum( info->type );
    339340                glBindBuffer( glenum, info->glid );
    340                 glBufferSubData( glenum, (GLintptr)offset, (GLsizeiptr)size, data );
     341                glBufferSubData( glenum, GLintptr( offset ), GLsizeiptr( size ), data );
    341342        }
    342343}
     
    700701void nv::gl_context::apply_engine_uniforms( program p, const scene_state& s )
    701702{
    702         gl_program_info* info = ((gl_device*)m_device)->m_programs.get( p );
     703        gl_program_info* info = static_cast<gl_device*>( m_device )->m_programs.get( p );
    703704        if ( info )
    704705        {
     
    725726                if ( slots[i] > OUTPUT_7 ) buffers[i] = 0;
    726727        }
    727         glDrawBuffers( (GLsizei)count, buffers );
     728        glDrawBuffers( GLsizei( count ), buffers );
    728729}
    729730
Note: See TracChangeset for help on using the changeset viewer.