fixes scissor and partly fixes chrome-shp transparency.
This commit is contained in:
@@ -13,6 +13,7 @@ namespace OpenRa.GlRenderer
|
|||||||
{
|
{
|
||||||
public class GraphicsDevice
|
public class GraphicsDevice
|
||||||
{
|
{
|
||||||
|
Size windowSize;
|
||||||
Graphics g;
|
Graphics g;
|
||||||
internal IntPtr dc;
|
internal IntPtr dc;
|
||||||
internal IntPtr rc;
|
internal IntPtr rc;
|
||||||
@@ -28,6 +29,7 @@ namespace OpenRa.GlRenderer
|
|||||||
|
|
||||||
public GraphicsDevice(Control control, int width, int height, bool fullscreen, bool vsync)
|
public GraphicsDevice(Control control, int width, int height, bool fullscreen, bool vsync)
|
||||||
{
|
{
|
||||||
|
windowSize = new Size( width, height );
|
||||||
g = control.CreateGraphics();
|
g = control.CreateGraphics();
|
||||||
dc = g.GetHdc();
|
dc = g.GetHdc();
|
||||||
|
|
||||||
@@ -75,7 +77,7 @@ namespace OpenRa.GlRenderer
|
|||||||
{
|
{
|
||||||
if( width < 0 ) width = 0;
|
if( width < 0 ) width = 0;
|
||||||
if( height < 0 ) height = 0;
|
if( height < 0 ) height = 0;
|
||||||
Gl.glScissor(left, top, width, height);
|
Gl.glScissor( left, windowSize.Height - ( top + height ), width, height );
|
||||||
CheckGlError();
|
CheckGlError();
|
||||||
Gl.glEnable(Gl.GL_SCISSOR_TEST);
|
Gl.glEnable(Gl.GL_SCISSOR_TEST);
|
||||||
CheckGlError();
|
CheckGlError();
|
||||||
|
|||||||
@@ -57,10 +57,14 @@ float4 Palette_fp(VertexOut f) : COLOR0 {
|
|||||||
|
|
||||||
technique low_quality {
|
technique low_quality {
|
||||||
pass p0 {
|
pass p0 {
|
||||||
BlendEnable = false;
|
BlendEnable = true;
|
||||||
DepthTestEnable = false;
|
DepthTestEnable = false;
|
||||||
CullFaceEnable = false;
|
CullFaceEnable = false;
|
||||||
VertexProgram = compile latest Simple_vp();
|
VertexProgram = compile latest Simple_vp();
|
||||||
FragmentProgram = compile latest Palette_fp();
|
FragmentProgram = compile latest Palette_fp();
|
||||||
|
|
||||||
|
BlendEquation = FuncAdd;
|
||||||
|
BlendFunc = int2( SrcAlpha, OneMinusSrcAlpha );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user