Changeset 1303 for trunk


Ignore:
Timestamp:
Apr 28, 2012, 3:38:32 PM (8 years ago)
Author:
sam
Message:

gpu: temporarily enable alpha blending in the vertex buffer code.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gpu/vertexbuffer.cpp

    r1292 r1303  
    124124{
    125125#if defined _XBOX || defined USE_D3D9
     126    g_d3ddevice->SetRenderState(D3DRS_ALPHABLENDENABLE, 1);
     127    g_d3ddevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
     128    g_d3ddevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
    126129    if (FAILED(g_d3ddevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW)))
    127130        Abort();
     
    134137    }
    135138#else
     139#   if defined HAVE_GL_2X && !defined __APPLE__
     140    glEnable(GL_ALPHA_TEST);
     141    glAlphaFunc(GL_GEQUAL, 0.01f);
     142#   endif
     143    glEnable(GL_BLEND);
     144    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     145
    136146    switch (type)
    137147    {
     
    148158{
    149159#if defined _XBOX || defined USE_D3D9
    150     if (FAILED(g_d3ddevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW)))
    151         Abort();
     160    g_d3ddevice->SetRenderState(D3DRS_ALPHABLENDENABLE, 1);
     161    g_d3ddevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
     162    g_d3ddevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
     163    g_d3ddevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CW);
    152164    switch (type)
    153165    {
     
    158170    }
    159171#else
     172#   if defined HAVE_GL_2X && !defined __APPLE__
     173    glEnable(GL_ALPHA_TEST);
     174    glAlphaFunc(GL_GEQUAL, 0.01f);
     175#   endif
     176    glEnable(GL_BLEND);
     177    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     178
    160179    switch (type)
    161180    {
  • trunk/src/video.cpp

    r1297 r1303  
    132132
    133133    g_d3ddevice = VideoData::d3d_dev;
    134 
    135     g_d3ddevice->SetRenderState(D3DRS_ALPHABLENDENABLE, 1);
    136     g_d3ddevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
    137     g_d3ddevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
    138134#else
    139135#   if defined USE_GLEW && !defined __APPLE__
     
    155151
    156152#   if defined HAVE_GL_2X && !defined __APPLE__
    157     glShadeModel(GL_SMOOTH);
    158153    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
    159154#   endif
Note: See TracChangeset for help on using the changeset viewer.