fixes scissor and partly fixes chrome-shp transparency.

This commit is contained in:
Bob
2010-02-16 17:23:43 +13:00
parent 20e586b9ad
commit 84badd39fe
2 changed files with 8 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ namespace OpenRa.GlRenderer
{
public class GraphicsDevice
{
Size windowSize;
Graphics g;
internal IntPtr dc;
internal IntPtr rc;
@@ -28,6 +29,7 @@ namespace OpenRa.GlRenderer
public GraphicsDevice(Control control, int width, int height, bool fullscreen, bool vsync)
{
windowSize = new Size( width, height );
g = control.CreateGraphics();
dc = g.GetHdc();
@@ -75,7 +77,7 @@ namespace OpenRa.GlRenderer
{
if( width < 0 ) width = 0;
if( height < 0 ) height = 0;
Gl.glScissor(left, top, width, height);
Gl.glScissor( left, windowSize.Height - ( top + height ), width, height );
CheckGlError();
Gl.glEnable(Gl.GL_SCISSOR_TEST);
CheckGlError();

View File

@@ -57,10 +57,14 @@ float4 Palette_fp(VertexOut f) : COLOR0 {
technique low_quality {
pass p0 {
BlendEnable = false;
BlendEnable = true;
DepthTestEnable = false;
CullFaceEnable = false;
VertexProgram = compile latest Simple_vp();
FragmentProgram = compile latest Palette_fp();
BlendEquation = FuncAdd;
BlendFunc = int2( SrcAlpha, OneMinusSrcAlpha );
}
}