]> O.S.I.I.S - jp/crow.git/commitdiff
code clean
authorjp <jp_bruyere@hotmail.com>
Thu, 14 Apr 2016 10:05:02 +0000 (12:05 +0200)
committerjp <jp_bruyere@hotmail.com>
Thu, 14 Apr 2016 10:09:30 +0000 (12:09 +0200)
Crow.csproj
OTKCrow/OpenTKGameWindow.cs
src/GraphicObjects/Popper.cs

index 3579f9a1d67a39ce455c1c3b8f5958a423e2fe94..90624a3dec77a14dd308d21d717f963df14ec415 100644 (file)
@@ -2,7 +2,7 @@
 <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" />
index b11c2ce0d598ff97f94f1f7b402adc83f80cbf5b..8f1f0156f8b991aa1d6f8f4b53534c8a854266e1 100644 (file)
@@ -113,6 +113,7 @@ namespace Crow
                                _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 ();
@@ -121,7 +122,6 @@ namespace Crow
 
                void interfaceThread()
                {
-                       CrowInterface = new Interface ();
                        CrowInterface.Quit += Quit;
                        CrowInterface.MouseCursorChanged += CrowInterface_MouseCursorChanged;
 
@@ -159,9 +159,8 @@ namespace Crow
 
                #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()
                {
@@ -180,27 +179,12 @@ namespace Crow
                        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,
@@ -210,12 +194,8 @@ namespace Crow
                                        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
 
@@ -248,7 +228,11 @@ namespace Crow
                        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)
index 69da1029a1ccc0eb5c58236697dbc201e084d9b3..4fd845548a0f06c1e3b88529bb2581c47b028c55 100644 (file)
@@ -121,7 +121,7 @@ namespace Crow
                        try {
                                if (_content.MouseIsIn (e.Position))
                                        return;
-                       } catch (Exception ex) {}
+                       } catch {}
                        IsPopped = false;
                }
                #endregion