Changeset 346


Ignore:
Timestamp:
11/18/14 14:56:13 (11 years ago)
Author:
epyon
Message:
  • raw string literals used (C++11)
Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gfx/debug_draw.cc

    r319 r346  
    99#include "nv/interface/device.hh"
    1010
    11 static const char *nv_debug_draw_vertex_shader =
    12         "#version 120\n"
    13         "attribute vec3 nv_position;\n"
    14         "attribute vec3 nv_color;\n"
    15         "varying vec3 v_color;\n"
    16         "uniform mat4 nv_m_mvp;\n"
    17         "void main(void)\n"
    18         "{\n"
    19         "       gl_Position = nv_m_mvp * vec4 (nv_position, 1.0);\n"
    20         "       v_color     = nv_color;\n"
    21         "}\n";
    22 static const char *nv_debug_draw_fragment_shader =
    23         "#version 120\n"
    24         "varying vec3 v_color;\n"
    25         "void main(void)\n"
    26         "{\n"
    27         "       gl_FragColor = vec4( v_color, 1.0 );\n"
    28         "}\n";
     11static const char *nv_debug_draw_vertex_shader = R"(
     12#version 120
     13attribute vec3 nv_position;
     14attribute vec3 nv_color;
     15varying vec3 v_color;
     16uniform mat4 nv_m_mvp;
     17void main(void)
     18{
     19        gl_Position = nv_m_mvp * vec4 (nv_position, 1.0);
     20        v_color     = nv_color;
     21};
     22)";
     23static const char *nv_debug_draw_fragment_shader = R"(
     24#version 120
     25varying vec3 v_color;
     26void main(void)
     27{
     28        gl_FragColor = vec4( v_color, 1.0 );
     29}
     30)";
    2931
    3032nv::debug_data::debug_data( context* a_context )
  • trunk/src/gui/gui_renderer.cc

    r328 r346  
    1313#include "nv/core/logging.hh"
    1414
    15 static const char *nv_gui_vertex_shader =
    16         "#version 120\n"
    17         "attribute vec2 nv_position;\n"
    18         "attribute vec2 nv_texcoord;\n"
    19         "attribute vec4 nv_color;\n"
    20         "varying vec4 v_color;\n"
    21         "varying vec2 v_texcoord;\n"
    22         "uniform mat4 nv_m_projection;\n"
    23         "void main(void)\n"
    24         "{\n"
    25         "       gl_Position = nv_m_projection * vec4(nv_position.x, nv_position.y, 0.0, 1.0);\n"
    26         "       v_texcoord  = nv_texcoord;\n"
    27         "       v_color     = nv_color;\n"
    28         "}\n";
    29 static const char *nv_gui_fragment_shader =
    30         "#version 120\n"
    31         "varying vec4 v_color;\n"
    32         "varying vec2 v_texcoord;\n"
    33         "uniform sampler2D nv_t_diffuse;\n"
    34         "void main(void)\n"
    35         "{\n"
    36         "       vec4 tex_color = texture2D( nv_t_diffuse, v_texcoord );\n"
    37         "       gl_FragColor   = v_color * tex_color;\n"
    38         "}\n";
     15static const char *nv_gui_vertex_shader = R"(
     16#version 120
     17attribute vec2 nv_position;
     18attribute vec2 nv_texcoord;
     19attribute vec4 nv_color;
     20varying vec4 v_color;
     21varying vec2 v_texcoord;
     22uniform mat4 nv_m_projection;
     23void main(void)
     24{
     25        gl_Position = nv_m_projection * vec4(nv_position.x, nv_position.y, 0.0, 1.0);
     26        v_texcoord  = nv_texcoord;
     27        v_color     = nv_color;
     28}
     29)";
     30
     31static const char *nv_gui_fragment_shader = R"(
     32#version 120
     33varying vec4 v_color;
     34varying vec2 v_texcoord;
     35uniform sampler2D nv_t_diffuse;
     36void main(void)
     37{
     38        vec4 tex_color = texture2D( nv_t_diffuse, v_texcoord );
     39        gl_FragColor   = v_color * tex_color;
     40}
     41)";
    3942
    4043
Note: See TracChangeset for help on using the changeset viewer.