Changeset 466


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
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv.lua

    r410 r466  
     1NV_RUNTIME = NV_RUNTIME or "scrt"
     2
    13project "nv-core"
    2         location (_ACTION)
     4        location (_ACTION.."/"..NV_RUNTIME)
    35        language "C++"
    46        kind "StaticLib"
     
    79
    810project "nv-lib"
    9         location (_ACTION)
     11        location (_ACTION.."/"..NV_RUNTIME)
    1012        language "C++"
    1113        kind "StaticLib"
     
    1517
    1618project "nv-curses"
    17         location (_ACTION)
     19        location (_ACTION.."/"..NV_RUNTIME)
    1820        language "C++"
    1921        kind "StaticLib"
     
    2325
    2426project "nv-fmod"
    25         location (_ACTION)
     27        location (_ACTION.."/"..NV_RUNTIME)
    2628        language "C++"
    2729        kind "StaticLib"
     
    3133
    3234project "nv-sdl"
    33         location (_ACTION)
     35        location (_ACTION.."/"..NV_RUNTIME)
    3436        language "C++"
    3537        kind "StaticLib"
     
    3941
    4042project "nv-gl"
    41         location (_ACTION)
     43        location (_ACTION.."/"..NV_RUNTIME)
    4244        language "C++"
    4345        kind "StaticLib"
     
    4749
    4850project "nv-lua"
    49         location (_ACTION)
     51        location (_ACTION.."/"..NV_RUNTIME)
    5052        language "C++"
    5153        kind "StaticLib"
     
    5557
    5658project "nv-rogue"
    57         location (_ACTION)
     59        location (_ACTION.."/"..NV_RUNTIME)
    5860        language "C++"
    5961        kind "StaticLib"
     
    6365
    6466project "nv-io"
    65         location (_ACTION)
     67        location (_ACTION.."/"..NV_RUNTIME)
    6668        language "C++"
    6769        kind "StaticLib"
     
    7173
    7274project "nv-gfx"
    73         location (_ACTION)
     75        location (_ACTION.."/"..NV_RUNTIME)
    7476        language "C++"
    7577        kind "StaticLib"
     
    7981
    8082project "nv-engine"
    81         location (_ACTION)
     83        location (_ACTION.."/"..NV_RUNTIME)
    8284        language "C++"
    8385        kind "StaticLib"
     
    8789
    8890project "nv-formats"
    89         location (_ACTION)
     91        location (_ACTION.."/"..NV_RUNTIME)
    9092        language "C++"
    9193        kind "StaticLib"
     
    9597
    9698project "nv-gui"
    97         location (_ACTION)
     99        location (_ACTION.."/"..NV_RUNTIME)
    98100        language "C++"
    99101        kind "StaticLib"
  • trunk/nv/wx/wx.hh

    r395 r466  
    1414#define __GL_H__
    1515#include <stddef.h>
    16 #include <nv/lib/detail/gl_types.inc>
     16#include <nv/lib/detail/gl_core/gl_types_3_1.inc>
    1717#include "wx/wx.h"
    1818#undef near
  • trunk/nv_wx.lua

    r410 r466  
     1assert( NV_RUNTIME == "dcrt" )
     2
    13project "nv-wx"
     4        location (_ACTION.."/"..NV_RUNTIME)
    25        language "C++"
    36        kind "StaticLib"
  • 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,
  • trunk/src/lib/gl.cc

    r463 r466  
    2626#define NV_GL_FUN_REN( rtype, fname, rname, fparams ) rtype (NV_GL_APIENTRY *rname) fparams = nullptr;
    2727#define NV_GL_FUN_EXT NV_GL_FUN
    28 #include <nv/lib/detail/gl_functions.inc>
     28#include <nv/lib/detail/gl_core/gl_functions_3_1.inc>
    2929#if NV_PLATFORM == NV_WINDOWS
    3030#include <nv/lib/detail/wgl_functions.inc>
    3131#endif
    32 #include <nv/lib/detail/gl_ext/gl_ext_all_functions.inc>
    3332#undef NV_GL_FUN_REN
    3433#undef NV_GL_FUN_EXT
     
    107106#       define NV_GL_FUN( rtype, fname, fparams ) NV_GL_LOAD( fname )
    108107#       define NV_GL_FUN_EXT( rtype, fname, fparams ) NV_GL_LOAD_EXT( fname )
    109 #       include <nv/lib/detail/gl_functions.inc>
     108#       include <nv/lib/detail/gl_core/gl_functions_3_1.inc>
    110109#       undef NV_GL_FUN_EXT
    111110#       undef NV_GL_FUN
Note: See TracChangeset for help on using the changeset viewer.