<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <!-- <Platform Condition=" '$(Platform)' == '' ">Linux_x86</Platform>-->
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C2980F9B-4798-4C05-99E2-E174810F7C7B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<NoStdLib>False</NoStdLib>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
- <OutputPath>bin\$(Configuration)</OutputPath>
- <IntermediateOutputPath>obj\$(Configuration)</IntermediateOutputPath>
+ <OutputPath>$(SolutionDir)/build/$(Configuration)</OutputPath>
+ <IntermediateOutputPath>$(SolutionDir)/build/obj/$(Configuration)</IntermediateOutputPath>
<WarningLevel>4</WarningLevel>
<NoWin32Manifest>False</NoWin32Manifest>
<SignAssembly>false</SignAssembly>
<DelaySign>False</DelaySign>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ReleaseVersion>0.4</ReleaseVersion>
<Description>Crow project description</Description>
+ <BaseAddress>4194304</BaseAddress>
</PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
- <DefineConstants>TRACE;DEBUG;__linux__</DefineConstants>
- <Optimize>False</Optimize>
+ <DebugType>full</DebugType>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
- <DebugType>Full</DebugType>
- <BaseAddress>4194304</BaseAddress>
+ <DefineConstants>DEBUG_LAYOUTING0;TRACE;DEBUG;__linux__;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>
+ <Optimize>false</Optimize>
</PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
- <DefineConstants>__linux__</DefineConstants>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>True</Optimize>
- <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DebugType>None</DebugType>
- <BaseAddress>4194304</BaseAddress>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <OutputPath>bin\Release</OutputPath>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <OutputPath>bin\Debug</OutputPath>
- <DefineConstants>DEBUG_LAYOUTING0;TRACE;DEBUG;__linux__;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>
- </PropertyGroup>
- <!-- <PropertyGroup Condition=" '$(Platform)' == 'Linux_x86' ">
- <DefineConstants>__linux__</DefineConstants>
- <PlatformTarget>x86</PlatformTarget>
- <BaseAddress>4194304</BaseAddress>
+ <DefineConstants>__linux__;MEASURE_TIME</DefineConstants>
</PropertyGroup>
- <PropertyGroup Condition=" '$$(Platform)' == 'Win_x86' ">
- <DefineConstants>_WIN32</DefineConstants>
- </PropertyGroup>-->
- <!-- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Linux_x86' ">
- <DefineConstants>DEBUG;__linux__;DEBUG;TRACE</DefineConstants>
- <PlatformTarget>anycpu</PlatformTarget>
- </PropertyGroup>-->
<ItemGroup>
<Compile Include="src\Colors.cs" />
<Compile Include="src\Point.cs" />
_title,GameWindowFlags.Default,DisplayDevice.GetDisplay(DisplayIndex.Second),
3,3,OpenTK.Graphics.GraphicsContextFlags.Default)
{
+ CrowInterface = new Interface ();
Thread t = new Thread (interfaceThread);
t.IsBackground = true;
t.Start ();
void interfaceThread()
{
- CrowInterface = new Interface ();
CrowInterface.Quit += Quit;
CrowInterface.MouseCursorChanged += CrowInterface_MouseCursorChanged;
#region graphic context
int texID;
- QuadVAO uiQuad;
- Crow.Shader shader;
- int[] viewport = new int[4];
+ Tetra.Shader shader;
+ public static GGL.vaoMesh quad;
void createContext()
{
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
GL.BindTexture(TextureTarget.Texture2D, 0);
-
- shader.Texture = texID;
- #endregion
-
- #region Update ui quad
- if (uiQuad != null)
- uiQuad.Dispose ();
- uiQuad = new QuadVAO (0, 0, ClientRectangle.Width, ClientRectangle.Height, 0, 1, 1, -1);
-
- shader.ProjectionMatrix = Matrix4.CreateOrthographicOffCenter
- (0, ClientRectangle.Width, ClientRectangle.Height, 0, 0, 1);
#endregion
-
- //TODO:add maybe clientrectangle to clipping here
}
void OpenGLDraw()
{
- GL.GetInteger (GetPName.Viewport, viewport);
- GL.Viewport (0, 0, ClientRectangle.Width, ClientRectangle.Height);
-
shader.Enable ();
+ GL.BindTexture (TextureTarget.Texture2D, texID);
lock (CrowInterface.RenderMutex) {
if (CrowInterface.IsDirty) {
GL.TexSubImage2D (TextureTarget.Texture2D, 0,
CrowInterface.IsDirty = false;
}
}
-
- uiQuad.Render (PrimitiveType.TriangleStrip);
+ quad.Render (PrimitiveType.TriangleStrip);
GL.BindTexture(TextureTarget.Texture2D, 0);
-
- shader.Disable ();
- GL.Viewport (viewport [0], viewport [1], viewport [2], viewport [3]);
}
#endregion
Console.WriteLine("GLSL version: " + GL.GetString (StringName.ShadingLanguageVersion));
Console.WriteLine("*************************************\n");
- shader = new Crow.TexturedShader ();
+ shader = new Tetra.Shader ();
+ shader.Enable();
+ shader.SetMVP(OpenTK.Matrix4.CreateOrthographicOffCenter (-0.5f, 0.5f, -0.5f, 0.5f, 1, -1));
+ GL.UseProgram(0);
+ quad = new GGL.vaoMesh (0, 0, 0, 1, 1, 1, -1);
}
protected override void OnUpdateFrame(FrameEventArgs e)