Changeset 466 for trunk/src/gl


Ignore:
Timestamp:
09/04/15 17:46:48 (10 years ago)
Author:
epyon
Message:
  • support for separate runtime CRT build
  • wx fix for new gl headers
Location:
trunk/src/gl
Files:
3 edited

Legend:

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

    r463 r466  
    177177                case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT         : NV_LOG_ERROR( "gl_context::check : Framebuffer incomplete attachment!" ); break;
    178178                case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT : NV_LOG_ERROR( "gl_context::check : Framebuffer missing attachment!" ); break;
    179                 case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS         : NV_LOG_ERROR( "gl_context::check : Framebuffer incomplete dimensions!" ); break;
    180                 case GL_FRAMEBUFFER_INCOMPLETE_FORMATS            : NV_LOG_ERROR( "gl_context::check : Framebuffer incomplete formats!" ); break;
     179//              case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS         : NV_LOG_ERROR( "gl_context::check : Framebuffer incomplete dimensions!" ); break;
     180//              case GL_FRAMEBUFFER_INCOMPLETE_FORMATS            : NV_LOG_ERROR( "gl_context::check : Framebuffer incomplete formats!" ); break;
    181181                case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER        : NV_LOG_ERROR( "gl_context::check : Framebuffer incomplete draw buffer!" ); break;
    182182                case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER        : NV_LOG_ERROR( "gl_context::check : Framebuffer incomplete read buffer!" ); break;
  • trunk/src/gl/gl_device.cc

    r463 r466  
    1717gl_device::gl_device()
    1818{
    19         m_shader_header.append( "#version 120\n#extension GL_EXT_texture_array : require\n" );
     19        m_shader_header.append( "#version 330\n" );
    2020        for ( auto& i : get_uniform_factory() )
    2121                m_shader_header.append( "uniform "+datatype_to_glsl_type( i.second->get_datatype() )+" "+ i.first +";\n" );
     
    124124        if ( is_depth )
    125125        {
    126 #define GL_TEXTURE_DEPTH_SIZE 0x884A
    127 #define GL_DEPTH_TEXTURE_MODE 0x884B
    128 #define GL_TEXTURE_COMPARE_MODE 0x884C
    129 #define GL_TEXTURE_COMPARE_FUNC 0x884D
    130 #define GL_COMPARE_R_TO_TEXTURE 0x884E
    131 
    132 #define GL_INTENSITY 0x8049
    133 #define GL_LUMINANCE 0x1909
    134 //              glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE );
    135 //              glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL );
    136 //              glTexParameteri( GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_LUMINANCE );
    137 //              glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, 0 );
    138 //              glTexParameteri( GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_INTENSITY );
     126                glTexParameteri( gl_type, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
     127                glTexParameteri( gl_type, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
     128
     129                // This is to allow usage of shadow2DProj function in the shader
     130                glTexParameteri( gl_type, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE );
     131                glTexParameteri( gl_type, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL );
    139132        }
    140133
     
    182175        glTexParameteri( gl_type, GL_TEXTURE_WRAP_T, GLint( nv::sampler_wrap_to_enum( asampler.wrap_t ) ) );
    183176
     177        if ( is_depth )
     178        {
     179                glTexParameteri( gl_type, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
     180                glTexParameteri( gl_type, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
     181
     182                // This is to allow usage of shadow2DProj function in the shader
     183                glTexParameteri( gl_type, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE );
     184                glTexParameteri( gl_type, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL );
     185        }
     186
    184187        //glTexStorage3D( GL_TEXTURE_2D_ARRAY, mipLevelCount, GL_RGBA8, width, height, layerCount );
    185188        glTexImage3D( gl_type, 0, GLint( nv::image_format_to_internal_enum( aformat.format ) ), size.x, size.y, size.z, 0, nv::image_format_to_enum( aformat.format ), nv::datatype_to_gl_enum( aformat.type ), data );
     
    366369        if ( length > 0 )
    367370        {
    368                 NV_LOG_INFO( "Program #", p->glid, " log: ", buffer );
     371                NV_LOG_INFO( "Program #", p->glid, " log: ", string_view( buffer, size_t( length ) ) );
    369372        }
    370373
  • trunk/src/gl/gl_window.cc

    r410 r466  
    7575        int attribs[] =
    7676        {
    77                 WGL_CONTEXT_MAJOR_VERSION_ARB,   2,
     77                WGL_CONTEXT_MAJOR_VERSION_ARB,   3,
    7878                WGL_CONTEXT_MINOR_VERSION_ARB,   1,
    7979                WGL_CONTEXT_PROFILE_MASK_ARB,  WGL_CONTEXT_CORE_PROFILE_BIT_ARB,
Note: See TracChangeset for help on using the changeset viewer.