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

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

File:
1 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    {
Note: See TracChangeset for help on using the changeset viewer.