]> O.S.I.I.S - jp/crow.git/commitdiff
lots of unordered changes, I commited all in a devel branch, which will be the progra...
authorjpbruyere <jp.bruyere@hotmail.com>
Tue, 19 Jul 2016 01:35:12 +0000 (03:35 +0200)
committerjpbruyere <jp.bruyere@hotmail.com>
Tue, 19 Jul 2016 01:35:12 +0000 (03:35 +0200)
34 files changed:
Crow.csproj
Crow.sln
GLCrow/GLCrow.csproj
OTKCrow/OTKCrow.csproj
OTKCrow/OpenGL/QuadVAO.cs [deleted file]
OTKCrow/OpenGL/Shader.cs
OTKCrow/OpenGL/TexturedShader.cs [deleted file]
OTKCrow/OpenGL/VertexArrayObject.cs [deleted file]
OTKCrow/OpenGL/vaoMesh.cs [new file with mode: 0644]
OTKCrow/OpenTK.dll.config [deleted file]
OTKCrow/OpenTKGameWindow.cs
OTKCrow/packages.config
README.md
Styles/Slider.style [new file with mode: 0644]
Styles/TabItem.style [new file with mode: 0644]
Tests/GOLIBTestsOTK.cs
Tests/OTKCrow.cs [new file with mode: 0644]
Tests/Tests.csproj
Tests/main.cs [new file with mode: 0644]
Tests/packages.config [new file with mode: 0644]
Tests/ui/LabelButton.style [new file with mode: 0644]
Tests/ui/MenuItem.style [new file with mode: 0644]
Tests/ui/Popper.template [new file with mode: 0755]
Tests/ui/fps.crow [deleted file]
Tests/ui/test.crow [new file with mode: 0755]
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/HorizontalStack.cs
src/GraphicObjects/Popper.cs
src/GraphicObjects/Slider.cs
src/GraphicObjects/TabItem.cs
src/GraphicObjects/VerticalStack.cs
src/Interface.cs
src/LayoutingQueueItem.cs
src/Measure.cs

index eaae1e2e487d1a821ee9ca49eebb61d76d12070d..d9d49339286ac29d1c5739a096d36c7b13ed5963 100644 (file)
     <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
     <DefineConstants>DEBUG_FOCUS0;DEBUG_LAYOUTING0;TRACE;DEBUG;__linux__;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>
     <Optimize>false</Optimize>
+    <IntermediateOutputPath>build\obj\Debug</IntermediateOutputPath>
+    <OutputPath>build\Debug</OutputPath>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <Optimize>True</Optimize>
     <DebugType>None</DebugType>
     <DefineConstants>__linux__;MEASURE_TIME</DefineConstants>
+    <IntermediateOutputPath>build\obj\Release</IntermediateOutputPath>
+    <OutputPath>build\Release</OutputPath>
   </PropertyGroup>
   <ItemGroup>
-    <Compile Include="src\Colors.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Point.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Rectangle.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Rectangles.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Size.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\GraphicObject.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\Container.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\Group.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\HorizontalStack.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\Image.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\Label.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\TextBox.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\ProgressBar.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\VerticalStack.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Cairo\CairoHelpers.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\win32\Win32.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\win32\winApi.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\Button.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\GraduatedSlider.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\Slider.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\NumericControl.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\Scroller.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\ILayoutable.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Enums.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\GenericStack.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\CompilerServices\CompilerServices.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\AnalogMeter.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\Border.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Font.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\Window.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\ListBox.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\ExtensionsMethods.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Interface.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\LayoutingQueueItem.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\Spinner.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\DynAttribute.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\IValueChange.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Picture.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\SvgPicture.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\BmpPicture.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\TemplatedControl.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\RadioButton.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\Expandable.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\PrivateContainer.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\TemplatedContainer.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\Popper.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\TextChangeEventArgs.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\ReflexionExtensions.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\XCursor.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\Grid.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\TextRun.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\MessageBox.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\SelectionChangeEventArgs.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\ValueChangeEventArgs.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\FileDialog.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\CheckBox.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\ComboBox.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\GroupBox.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\ScrollBar.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\BubblingMouseButtonEventArgs.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\SolidColor.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Gradient.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Fill\Fill.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\LayoutingEventArgs.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\ScrollingEventArgs.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\Trend.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\Splitter.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\TreeView.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\TabView.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\TabItem.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\DummyTemplate.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Input\KeyboardKeyEventArgs.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Input\Buttons.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Input\ButtonState.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Input\Key.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Input\KeyboardState.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Input\KeyModifiers.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Input\MouseButton.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Input\MouseEventArgs.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Input\MouseScroll.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Input\MouseState.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\rsvg\DimensionData.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\rsvg\Global.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\rsvg\Handle.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\rsvg\Pixbuf.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\rsvg\RsvgSharp.SizeFuncNative.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\rsvg\SizeFunc.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\MouseCursorChangedEventArgs.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\GraphicObjects\IBindable.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Input\KeyPressEventArgs.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Configuration.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="src\Measure.cs">
-      <LogicalName></LogicalName>
-    </Compile>
+    <Compile Include="src\Colors.cs" />
+    <Compile Include="src\Point.cs" />
+    <Compile Include="src\Rectangle.cs" />
+    <Compile Include="src\Rectangles.cs" />
+    <Compile Include="src\Size.cs" />
+    <Compile Include="src\GraphicObjects\GraphicObject.cs" />
+    <Compile Include="src\GraphicObjects\Container.cs" />
+    <Compile Include="src\GraphicObjects\Group.cs" />
+    <Compile Include="src\GraphicObjects\HorizontalStack.cs" />
+    <Compile Include="src\GraphicObjects\Image.cs" />
+    <Compile Include="src\GraphicObjects\Label.cs" />
+    <Compile Include="src\GraphicObjects\TextBox.cs" />
+    <Compile Include="src\GraphicObjects\ProgressBar.cs" />
+    <Compile Include="src\GraphicObjects\VerticalStack.cs" />
+    <Compile Include="src\Cairo\CairoHelpers.cs" />
+    <Compile Include="src\win32\Win32.cs" />
+    <Compile Include="src\win32\winApi.cs" />
+    <Compile Include="src\GraphicObjects\Button.cs" />
+    <Compile Include="src\GraphicObjects\GraduatedSlider.cs" />
+    <Compile Include="src\GraphicObjects\Slider.cs" />
+    <Compile Include="src\GraphicObjects\NumericControl.cs" />
+    <Compile Include="src\GraphicObjects\Scroller.cs" />
+    <Compile Include="src\GraphicObjects\ILayoutable.cs" />
+    <Compile Include="src\Enums.cs" />
+    <Compile Include="src\GraphicObjects\GenericStack.cs" />
+    <Compile Include="src\CompilerServices\CompilerServices.cs" />
+    <Compile Include="src\GraphicObjects\AnalogMeter.cs" />
+    <Compile Include="src\GraphicObjects\Border.cs" />
+    <Compile Include="src\Font.cs" />
+    <Compile Include="src\GraphicObjects\Window.cs" />
+    <Compile Include="src\GraphicObjects\ListBox.cs" />
+    <Compile Include="src\ExtensionsMethods.cs" />
+    <Compile Include="src\Interface.cs" />
+    <Compile Include="src\LayoutingQueueItem.cs" />
+    <Compile Include="src\GraphicObjects\Spinner.cs" />
+    <Compile Include="src\DynAttribute.cs" />
+    <Compile Include="src\GraphicObjects\IValueChange.cs" />
+    <Compile Include="src\Picture.cs" />
+    <Compile Include="src\SvgPicture.cs" />
+    <Compile Include="src\BmpPicture.cs" />
+    <Compile Include="src\GraphicObjects\TemplatedControl.cs" />
+    <Compile Include="src\GraphicObjects\RadioButton.cs" />
+    <Compile Include="src\GraphicObjects\Expandable.cs" />
+    <Compile Include="src\GraphicObjects\PrivateContainer.cs" />
+    <Compile Include="src\GraphicObjects\TemplatedContainer.cs" />
+    <Compile Include="src\GraphicObjects\Popper.cs" />
+    <Compile Include="src\TextChangeEventArgs.cs" />
+    <Compile Include="src\ReflexionExtensions.cs" />
+    <Compile Include="src\XCursor.cs" />
+    <Compile Include="src\GraphicObjects\Grid.cs" />
+    <Compile Include="src\GraphicObjects\TextRun.cs" />
+    <Compile Include="src\GraphicObjects\MessageBox.cs" />
+    <Compile Include="src\SelectionChangeEventArgs.cs" />
+    <Compile Include="src\ValueChangeEventArgs.cs" />
+    <Compile Include="src\GraphicObjects\FileDialog.cs" />
+    <Compile Include="src\GraphicObjects\CheckBox.cs" />
+    <Compile Include="src\GraphicObjects\ComboBox.cs" />
+    <Compile Include="src\GraphicObjects\GroupBox.cs" />
+    <Compile Include="src\GraphicObjects\ScrollBar.cs" />
+    <Compile Include="src\BubblingMouseButtonEventArgs.cs" />
+    <Compile Include="src\SolidColor.cs" />
+    <Compile Include="src\Gradient.cs" />
+    <Compile Include="src\Fill\Fill.cs" />
+    <Compile Include="src\LayoutingEventArgs.cs" />
+    <Compile Include="src\ScrollingEventArgs.cs" />
+    <Compile Include="src\GraphicObjects\Trend.cs" />
+    <Compile Include="src\GraphicObjects\Splitter.cs" />
+    <Compile Include="src\GraphicObjects\TreeView.cs" />
+    <Compile Include="src\GraphicObjects\TabView.cs" />
+    <Compile Include="src\GraphicObjects\TabItem.cs" />
+    <Compile Include="src\GraphicObjects\DummyTemplate.cs" />
+    <Compile Include="src\Input\KeyboardKeyEventArgs.cs" />
+    <Compile Include="src\Input\Buttons.cs" />
+    <Compile Include="src\Input\ButtonState.cs" />
+    <Compile Include="src\Input\Key.cs" />
+    <Compile Include="src\Input\KeyboardState.cs" />
+    <Compile Include="src\Input\KeyModifiers.cs" />
+    <Compile Include="src\Input\MouseButton.cs" />
+    <Compile Include="src\Input\MouseEventArgs.cs" />
+    <Compile Include="src\Input\MouseScroll.cs" />
+    <Compile Include="src\Input\MouseState.cs" />
+    <Compile Include="src\rsvg\DimensionData.cs" />
+    <Compile Include="src\rsvg\Global.cs" />
+    <Compile Include="src\rsvg\Handle.cs" />
+    <Compile Include="src\rsvg\Pixbuf.cs" />
+    <Compile Include="src\rsvg\RsvgSharp.SizeFuncNative.cs" />
+    <Compile Include="src\rsvg\SizeFunc.cs" />
+    <Compile Include="src\MouseCursorChangedEventArgs.cs" />
+    <Compile Include="src\GraphicObjects\IBindable.cs" />
+    <Compile Include="src\Input\KeyPressEventArgs.cs" />
+    <Compile Include="src\Configuration.cs" />
+    <Compile Include="src\Measure.cs" />
     <Compile Include="src\CompilerServices\MemberReference.cs" />
     <Compile Include="src\CompilerServices\Bindings.cs" />
   </ItemGroup>
     <EmbeddedResource Include="Styles\Window.style" />
     <EmbeddedResource Include="Styles\TextBox.style" />
     <EmbeddedResource Include="Styles\TextRun.style" />
+    <EmbeddedResource Include="Styles\TabItem.style" />
+    <EmbeddedResource Include="Styles\Slider.style" />
   </ItemGroup>
   <ItemGroup>
-    <None Include="README.md">
-      <LogicalName></LogicalName>
-    </None>
-    <None Include="packages.config">
-      <LogicalName></LogicalName>
-    </None>
+    <None Include="README.md" />
+    <None Include="packages.config" />
   </ItemGroup>
 </Project>
index fd256cc4025b2c8a4248524676cf603fd7b8d974..9ed39d880c827040991170ab7ef536d824ef5222 100644 (file)
--- a/Crow.sln
+++ b/Crow.sln
@@ -5,123 +5,40 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow", "Crow.csproj", "{C29
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests", "Tests\Tests.csproj", "{74289092-9F70-4941-AFCB-DFD7BE2140B6}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.GOLib", "MonoDevelop.GOLib\MonoDevelop.GOLib.csproj", "{E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.Diagram", "..\MonoDevelop.Diagram\MonoDevelop.Diagram.csproj", "{232716B4-D19D-4FD7-B310-94A98FD926F0}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTest", "UnitTest\UnitTest.csproj", "{7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OTKCrow", "OTKCrow\OTKCrow.csproj", "{350D4F49-9901-4998-9903-BCA7D48DA58C}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GtkCrow", "GtkCrow\GtkCrow.csproj", "{D6F98B08-56B8-405C-9212-F9D26097E35F}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GLCrow", "GLCrow\GLCrow.csproj", "{66376B95-9351-4A63-B920-F4BB53FEF0E2}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pencil.Gaming", "..\..\src\Pencil.Gaming\Pencil.Gaming\Pencil.Gaming.csproj", "{DDB6DB6D-E5DE-4BDB-8AC8-26DF800E9FF0}"
-EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
+               Debug|Any CPU = Debug|Any CPU
+               Release|Any CPU = Release|Any CPU
                Debug|Linux_x86 = Debug|Linux_x86
                Release|Linux_x86 = Release|Linux_x86
-               Compatibility-GLFW2|Any CPU = Compatibility-GLFW2|Any CPU
-               Core-GLFW2|Any CPU = Core-GLFW2|Any CPU
-               Compatibility-GLFW3|Any CPU = Compatibility-GLFW3|Any CPU
-               Core-GLFW3|Any CPU = Core-GLFW3|Any CPU
        EndGlobalSection
        GlobalSection(ProjectConfigurationPlatforms) = postSolution
-               {232716B4-D19D-4FD7-B310-94A98FD926F0}.Compatibility-GLFW2|Any CPU.ActiveCfg = Debug|Any CPU
-               {232716B4-D19D-4FD7-B310-94A98FD926F0}.Compatibility-GLFW2|Any CPU.Build.0 = Debug|Any CPU
-               {232716B4-D19D-4FD7-B310-94A98FD926F0}.Compatibility-GLFW3|Any CPU.ActiveCfg = Debug|Any CPU
-               {232716B4-D19D-4FD7-B310-94A98FD926F0}.Compatibility-GLFW3|Any CPU.Build.0 = Debug|Any CPU
-               {232716B4-D19D-4FD7-B310-94A98FD926F0}.Core-GLFW2|Any CPU.ActiveCfg = Debug|Any CPU
-               {232716B4-D19D-4FD7-B310-94A98FD926F0}.Core-GLFW2|Any CPU.Build.0 = Debug|Any CPU
-               {232716B4-D19D-4FD7-B310-94A98FD926F0}.Core-GLFW3|Any CPU.ActiveCfg = Debug|Any CPU
-               {232716B4-D19D-4FD7-B310-94A98FD926F0}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU
-               {232716B4-D19D-4FD7-B310-94A98FD926F0}.Release|Linux_x86.ActiveCfg = Debug|Any CPU
-               {350D4F49-9901-4998-9903-BCA7D48DA58C}.Compatibility-GLFW2|Any CPU.ActiveCfg = Debug|Linux_x86
-               {350D4F49-9901-4998-9903-BCA7D48DA58C}.Compatibility-GLFW2|Any CPU.Build.0 = Debug|Linux_x86
-               {350D4F49-9901-4998-9903-BCA7D48DA58C}.Compatibility-GLFW3|Any CPU.ActiveCfg = Debug|Linux_x86
-               {350D4F49-9901-4998-9903-BCA7D48DA58C}.Compatibility-GLFW3|Any CPU.Build.0 = Debug|Linux_x86
-               {350D4F49-9901-4998-9903-BCA7D48DA58C}.Core-GLFW2|Any CPU.ActiveCfg = Debug|Linux_x86
-               {350D4F49-9901-4998-9903-BCA7D48DA58C}.Core-GLFW2|Any CPU.Build.0 = Debug|Linux_x86
-               {350D4F49-9901-4998-9903-BCA7D48DA58C}.Core-GLFW3|Any CPU.ActiveCfg = Debug|Linux_x86
-               {350D4F49-9901-4998-9903-BCA7D48DA58C}.Debug|Linux_x86.ActiveCfg = Debug|Linux_x86
-               {350D4F49-9901-4998-9903-BCA7D48DA58C}.Release|Linux_x86.ActiveCfg = Release|Linux_x86
-               {66376B95-9351-4A63-B920-F4BB53FEF0E2}.Compatibility-GLFW2|Any CPU.ActiveCfg = Debug|Linux_x86
-               {66376B95-9351-4A63-B920-F4BB53FEF0E2}.Compatibility-GLFW2|Any CPU.Build.0 = Debug|Linux_x86
-               {66376B95-9351-4A63-B920-F4BB53FEF0E2}.Compatibility-GLFW3|Any CPU.ActiveCfg = Debug|Linux_x86
-               {66376B95-9351-4A63-B920-F4BB53FEF0E2}.Compatibility-GLFW3|Any CPU.Build.0 = Debug|Linux_x86
-               {66376B95-9351-4A63-B920-F4BB53FEF0E2}.Core-GLFW2|Any CPU.ActiveCfg = Debug|Linux_x86
-               {66376B95-9351-4A63-B920-F4BB53FEF0E2}.Core-GLFW2|Any CPU.Build.0 = Debug|Linux_x86
-               {66376B95-9351-4A63-B920-F4BB53FEF0E2}.Core-GLFW3|Any CPU.ActiveCfg = Debug|Linux_x86
-               {66376B95-9351-4A63-B920-F4BB53FEF0E2}.Core-GLFW3|Any CPU.Build.0 = Debug|Linux_x86
-               {66376B95-9351-4A63-B920-F4BB53FEF0E2}.Debug|Linux_x86.ActiveCfg = Debug|Linux_x86
-               {66376B95-9351-4A63-B920-F4BB53FEF0E2}.Debug|Linux_x86.Build.0 = Debug|Linux_x86
-               {66376B95-9351-4A63-B920-F4BB53FEF0E2}.Release|Linux_x86.ActiveCfg = Release|Linux_x86
-               {66376B95-9351-4A63-B920-F4BB53FEF0E2}.Release|Linux_x86.Build.0 = Release|Linux_x86
-               {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Compatibility-GLFW2|Any CPU.ActiveCfg = Debug|Any CPU
-               {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Compatibility-GLFW2|Any CPU.Build.0 = Debug|Any CPU
-               {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Compatibility-GLFW3|Any CPU.ActiveCfg = Debug|Any CPU
-               {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Compatibility-GLFW3|Any CPU.Build.0 = Debug|Any CPU
-               {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Core-GLFW2|Any CPU.ActiveCfg = Debug|Any CPU
-               {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Core-GLFW2|Any CPU.Build.0 = Debug|Any CPU
-               {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Core-GLFW3|Any CPU.ActiveCfg = Debug|Any CPU
-               {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Core-GLFW3|Any CPU.Build.0 = Debug|Any CPU
+               {350D4F49-9901-4998-9903-BCA7D48DA58C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {350D4F49-9901-4998-9903-BCA7D48DA58C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {350D4F49-9901-4998-9903-BCA7D48DA58C}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU
+               {350D4F49-9901-4998-9903-BCA7D48DA58C}.Debug|Linux_x86.Build.0 = Debug|Any CPU
+               {350D4F49-9901-4998-9903-BCA7D48DA58C}.Release|Any CPU.ActiveCfg = Debug|Any CPU
+               {350D4F49-9901-4998-9903-BCA7D48DA58C}.Release|Any CPU.Build.0 = Debug|Any CPU
+               {350D4F49-9901-4998-9903-BCA7D48DA58C}.Release|Linux_x86.ActiveCfg = Release|Any CPU
+               {350D4F49-9901-4998-9903-BCA7D48DA58C}.Release|Linux_x86.Build.0 = Release|Any CPU
+               {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU
                {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Debug|Linux_x86.Build.0 = Debug|Any CPU
+               {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Any CPU.ActiveCfg = Debug|Any CPU
+               {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Any CPU.Build.0 = Debug|Any CPU
                {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Linux_x86.ActiveCfg = Release|Any CPU
                {74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Linux_x86.Build.0 = Release|Any CPU
-               {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Compatibility-GLFW2|Any CPU.ActiveCfg = Debug|Any CPU
-               {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Compatibility-GLFW2|Any CPU.Build.0 = Debug|Any CPU
-               {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Compatibility-GLFW3|Any CPU.ActiveCfg = Debug|Any CPU
-               {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Compatibility-GLFW3|Any CPU.Build.0 = Debug|Any CPU
-               {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Core-GLFW2|Any CPU.ActiveCfg = Debug|Any CPU
-               {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Core-GLFW2|Any CPU.Build.0 = Debug|Any CPU
-               {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Core-GLFW3|Any CPU.ActiveCfg = Debug|Any CPU
-               {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU
-               {7BAE4448-E8F4-48B3-BB11-FA78E7F4506B}.Release|Linux_x86.ActiveCfg = Release|Any CPU
-               {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Compatibility-GLFW2|Any CPU.ActiveCfg = Debug|Any CPU
-               {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Compatibility-GLFW2|Any CPU.Build.0 = Debug|Any CPU
-               {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Compatibility-GLFW3|Any CPU.ActiveCfg = Debug|Any CPU
-               {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Compatibility-GLFW3|Any CPU.Build.0 = Debug|Any CPU
-               {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Core-GLFW2|Any CPU.ActiveCfg = Debug|Any CPU
-               {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Core-GLFW2|Any CPU.Build.0 = Debug|Any CPU
-               {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Core-GLFW3|Any CPU.ActiveCfg = Debug|Any CPU
-               {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Core-GLFW3|Any CPU.Build.0 = Debug|Any CPU
+               {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU
                {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Linux_x86.Build.0 = Debug|Any CPU
+               {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Any CPU.ActiveCfg = Debug|Any CPU
+               {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Any CPU.Build.0 = Debug|Any CPU
                {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Linux_x86.ActiveCfg = Release|Any CPU
                {C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Linux_x86.Build.0 = Release|Any CPU
-               {D6F98B08-56B8-405C-9212-F9D26097E35F}.Compatibility-GLFW2|Any CPU.ActiveCfg = Debug|Linux_x86
-               {D6F98B08-56B8-405C-9212-F9D26097E35F}.Compatibility-GLFW2|Any CPU.Build.0 = Debug|Linux_x86
-               {D6F98B08-56B8-405C-9212-F9D26097E35F}.Compatibility-GLFW3|Any CPU.ActiveCfg = Debug|Linux_x86
-               {D6F98B08-56B8-405C-9212-F9D26097E35F}.Compatibility-GLFW3|Any CPU.Build.0 = Debug|Linux_x86
-               {D6F98B08-56B8-405C-9212-F9D26097E35F}.Core-GLFW2|Any CPU.ActiveCfg = Debug|Linux_x86
-               {D6F98B08-56B8-405C-9212-F9D26097E35F}.Core-GLFW2|Any CPU.Build.0 = Debug|Linux_x86
-               {D6F98B08-56B8-405C-9212-F9D26097E35F}.Core-GLFW3|Any CPU.ActiveCfg = Debug|Linux_x86
-               {D6F98B08-56B8-405C-9212-F9D26097E35F}.Debug|Linux_x86.ActiveCfg = Debug|Linux_x86
-               {D6F98B08-56B8-405C-9212-F9D26097E35F}.Release|Linux_x86.ActiveCfg = Release|Linux_x86
-               {DDB6DB6D-E5DE-4BDB-8AC8-26DF800E9FF0}.Compatibility-GLFW2|Any CPU.ActiveCfg = Core-GLFW3|Any CPU
-               {DDB6DB6D-E5DE-4BDB-8AC8-26DF800E9FF0}.Compatibility-GLFW2|Any CPU.Build.0 = Core-GLFW3|Any CPU
-               {DDB6DB6D-E5DE-4BDB-8AC8-26DF800E9FF0}.Compatibility-GLFW3|Any CPU.ActiveCfg = Compatibility-GLFW3|Any CPU
-               {DDB6DB6D-E5DE-4BDB-8AC8-26DF800E9FF0}.Compatibility-GLFW3|Any CPU.Build.0 = Compatibility-GLFW3|Any CPU
-               {DDB6DB6D-E5DE-4BDB-8AC8-26DF800E9FF0}.Core-GLFW2|Any CPU.ActiveCfg = Core-GLFW2|Any CPU
-               {DDB6DB6D-E5DE-4BDB-8AC8-26DF800E9FF0}.Core-GLFW2|Any CPU.Build.0 = Core-GLFW2|Any CPU
-               {DDB6DB6D-E5DE-4BDB-8AC8-26DF800E9FF0}.Core-GLFW3|Any CPU.ActiveCfg = Core-GLFW3|Any CPU
-               {DDB6DB6D-E5DE-4BDB-8AC8-26DF800E9FF0}.Core-GLFW3|Any CPU.Build.0 = Core-GLFW3|Any CPU
-               {DDB6DB6D-E5DE-4BDB-8AC8-26DF800E9FF0}.Debug|Linux_x86.ActiveCfg = Core-GLFW3|Any CPU
-               {DDB6DB6D-E5DE-4BDB-8AC8-26DF800E9FF0}.Debug|Linux_x86.Build.0 = Core-GLFW3|Any CPU
-               {DDB6DB6D-E5DE-4BDB-8AC8-26DF800E9FF0}.Release|Linux_x86.ActiveCfg = Core-GLFW3|Any CPU
-               {DDB6DB6D-E5DE-4BDB-8AC8-26DF800E9FF0}.Release|Linux_x86.Build.0 = Core-GLFW3|Any CPU
-               {E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}.Compatibility-GLFW2|Any CPU.ActiveCfg = Debug|Any CPU
-               {E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}.Compatibility-GLFW2|Any CPU.Build.0 = Debug|Any CPU
-               {E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}.Compatibility-GLFW3|Any CPU.ActiveCfg = Debug|Any CPU
-               {E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}.Compatibility-GLFW3|Any CPU.Build.0 = Debug|Any CPU
-               {E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}.Core-GLFW2|Any CPU.ActiveCfg = Debug|Any CPU
-               {E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}.Core-GLFW2|Any CPU.Build.0 = Debug|Any CPU
-               {E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}.Core-GLFW3|Any CPU.ActiveCfg = Debug|Any CPU
-               {E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}.Debug|Linux_x86.ActiveCfg = Debug|Any CPU
-               {E9E14DB5-3C67-4E01-B5C3-4D90D7E31A2E}.Release|Linux_x86.ActiveCfg = Release|Any CPU
        EndGlobalSection
        GlobalSection(MonoDevelopProperties) = preSolution
                Policies = $0
index a5ab35ab8c9a37f2e93ef93ad1c098910fa3e633..8c1cd3c7ab1ad379141c598b3a15197ce1b931f1 100644 (file)
@@ -9,7 +9,7 @@
     <OutputType>Library</OutputType>
     <RootNamespace>GLC</RootNamespace>
     <AssemblyName>GLCrow</AssemblyName>
-       <OutputPath>$(SolutionDir)/build/$(Configuration)</OutputPath>
+    <OutputPath>$(SolutionDir)/build/$(Configuration)</OutputPath>
     <IntermediateOutputPath>$(SolutionDir)/build/obj/$(Configuration)</IntermediateOutputPath>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <ReleaseVersion>0.4</ReleaseVersion>
         <Variable name="vblank_mode" value="1" />
       </EnvironmentVariables>
     </EnvironmentVariables>
+    <IntermediateOutputPath>$(SolutionDir)\build\obj\$(Configuration)</IntermediateOutputPath>
+    <OutputPath>$(SolutionDir)\build\$(Configuration)</OutputPath>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Linux_x86' ">
     <Optimize>true</Optimize>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <ConsolePause>false</ConsolePause>
+    <IntermediateOutputPath>$(SolutionDir)\build\obj\$(Configuration)</IntermediateOutputPath>
+    <OutputPath>$(SolutionDir)\build\$(Configuration)</OutputPath>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="cairo-sharp">
       <Project>{C2980F9B-4798-4C05-99E2-E174810F7C7B}</Project>
       <Name>Crow</Name>
     </ProjectReference>
-    <ProjectReference Include="..\..\..\src\Pencil.Gaming\Pencil.Gaming\Pencil.Gaming.csproj">
-      <Project>{DDB6DB6D-E5DE-4BDB-8AC8-26DF800E9FF0}</Project>
-      <Name>Pencil.Gaming</Name>
-    </ProjectReference>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Window.cs" />
index 65c9678e9c9e393924123973204cf865be930e31..bd5f22ebfe3831b7f9292655b00221e5928acc43 100644 (file)
@@ -2,7 +2,7 @@
 <Project DefaultTargets="Build" ToolsVersion="4.0" 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>{350D4F49-9901-4998-9903-BCA7D48DA58C}</ProjectGuid>
     <OutputType>Library</OutputType>
     <RootNamespace>OTKCrow</RootNamespace>
@@ -14,7 +14,7 @@
     <OutputPath>$(SolutionDir)/build/$(Configuration)</OutputPath>
     <IntermediateOutputPath>$(SolutionDir)/build/obj/$(Configuration)</IntermediateOutputPath>
   </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Linux_x86' ">
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <ConsolePause>false</ConsolePause>
+    <IntermediateOutputPath>$(SolutionDir)\build\obj\$(Configuration)</IntermediateOutputPath>
+    <OutputPath>$(SolutionDir)\build\$(Configuration)</OutputPath>
   </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Linux_x86' ">
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>full</DebugType>
     <Optimize>true</Optimize>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <ConsolePause>false</ConsolePause>
+    <IntermediateOutputPath>$(SolutionDir)\build\obj\$(Configuration)</IntermediateOutputPath>
+    <OutputPath>$(SolutionDir)\build\$(Configuration)</OutputPath>
   </PropertyGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <ItemGroup>
       <Package>gtk-sharp-3.0</Package>
     </Reference>
     <Reference Include="OpenTK">
-      <HintPath>..\packages\OpenTK.1.1.2225.0\lib\net20\OpenTK.dll</HintPath>
-    </Reference>
-    <Reference Include="GGL">
-      <HintPath>..\..\Chess\build\Debug\GGL.dll</HintPath>
+      <HintPath>..\packages\OpenTK.1.1.2349.61993\lib\NET40\OpenTK.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="OpenTKGameWindow.cs" />
-    <Compile Include="OpenGL\QuadVAO.cs" />
     <Compile Include="OpenGL\Shader.cs" />
-    <Compile Include="OpenGL\TexturedShader.cs" />
-    <Compile Include="OpenGL\VertexArrayObject.cs" />
+    <Compile Include="OpenGL\vaoMesh.cs" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\Crow.csproj">
@@ -60,7 +59,9 @@
     </ProjectReference>
   </ItemGroup>
   <ItemGroup>
-    <None Include="OpenTK.dll.config" />
+    <Folder Include="OpenGL\" />
+  </ItemGroup>
+  <ItemGroup>
     <None Include="packages.config" />
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/OTKCrow/OpenGL/QuadVAO.cs b/OTKCrow/OpenGL/QuadVAO.cs
deleted file mode 100644 (file)
index 36231cc..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-using System;
-using OpenTK;
-
-namespace Crow
-{
-       public class QuadVAO : VertexArrayObject
-       {
-               public QuadVAO (float x, float y, float width, float height):base(
-                       new Vector2[] {
-                               new Vector2 (x, y),
-                               new Vector2 (x, y + height),
-                               new Vector2 (x + width, y),
-                               new Vector2 (x + width, y + height)
-                       },
-                       new Vector2[] {
-                               new Vector2 (0, 1),
-                               new Vector2 (0, 0),
-                               new Vector2 (1, 1),
-                               new Vector2 (1, 0)
-                       },
-                       new int[] { 0, 1, 2, 3 })
-               {
-
-               }
-               public QuadVAO (float x, float y, float width, float height,
-                       float texX, float texY, float texW, float texH):base(
-                       new Vector2[] {
-                               new Vector2 (x, y),
-                               new Vector2 (x, y + height),
-                               new Vector2 (x + width, y),
-                               new Vector2 (x + width, y + height)
-                       },
-                       new Vector2[] {
-                                       new Vector2 (texX, texY+texH),
-                                       new Vector2 (texX, texY),
-                                       new Vector2 (texX+texW, texY+texH),
-                                       new Vector2 (texX+texW, texY)
-                       },
-                       new int[] { 0, 1, 2, 3 })
-               {
-
-               }
-       }
-}
index b4603ad8c1f937efb9f9920d25db91595f046b47..54f9140a3d56e479ab0183a064491fb984d97652 100644 (file)
@@ -4,76 +4,54 @@ using System.IO;
 using System.Reflection;
 using OpenTK;
 using OpenTK.Graphics.OpenGL;
+using System.Collections.Generic;
 
-namespace Crow
+namespace Tetra
 {
        public class Shader : IDisposable
        {
                #region CTOR
                public Shader ()
                {
-                       Compile ();
+                       Init ();
                }
-               public Shader (string vertResId, string fragResId)
+               public Shader (string vertResPath, string fragResPath = null, string geomResPath = null)
                {
+                       VertSourcePath = vertResPath;
+                       FragSourcePath = fragResPath;
+                       GeomSourcePath = geomResPath;
 
-                       Stream s = tryGetStreamForResource (vertResId);
-                       if (s != null) {
-                               using (StreamReader sr = new StreamReader (s)) {
-                                       vertSource = sr.ReadToEnd ();
-                               }
-                       }
+                       loadSourcesFiles ();
 
-                       s = tryGetStreamForResource (fragResId);
-                       if (s != null) {
-                               using (StreamReader sr = new StreamReader (s)) {
-                                       fragSource = sr.ReadToEnd ();
-                               }
-                       }
-
-                       Compile ();
-               }
-               Stream tryGetStreamForResource(string resId){
-                       if (string.IsNullOrEmpty (resId))
-                               return null;
-
-                       Stream s = Assembly.GetEntryAssembly ().
-                               GetManifestResourceStream (resId);
-                       return s == null ?
-                               Assembly.GetExecutingAssembly ().
-                                       GetManifestResourceStream (resId) :
-                               s;
+                       Init ();
                }
                #endregion
 
+               public string   VertSourcePath,
+                                               FragSourcePath,
+                                               GeomSourcePath;
                #region Sources
                protected string _vertSource = @"
                        #version 330
+                       precision lowp float;
 
-                       precision highp float;
-
-                       uniform mat4 Projection;
-                       uniform mat4 ModelView;
-                       uniform mat4 Model;
-                       uniform mat4 Normal;
+                       uniform mat4 mvp;
 
-                       in vec2 in_position;
-                       in vec2 in_tex;
+                       layout(location = 0) in vec3 in_position;
+                       layout(location = 1) in vec2 in_tex;
 
                        out vec2 texCoord;
 
-
                        void main(void)
                        {
                                texCoord = in_tex;
-                               gl_Position = Projection * ModelView * Model * vec4(in_position, 0, 1);
+                               gl_Position = mvp * vec4(in_position, 1.0);
                        }";
 
                protected string _fragSource = @"
                        #version 330
-                       precision highp float;
+                       precision lowp float;
 
-                       uniform vec4 color;
                        uniform sampler2D tex;
 
                        in vec2 texCoord;
@@ -99,18 +77,9 @@ namespace Crow
                #endregion
 
                #region Private and protected fields
-               protected int vsId, fsId, gsId, pgmId,
-                                               modelViewLocation,
-                                               modelLocation,
-                                               projectionLocation,
-                                               normalLocation,
-                                               colorLocation;
-
-               Matrix4 projectionMat = Matrix4.Identity,
-                               modelMat = Matrix4.Identity,
-                               modelViewMat = Matrix4.Identity;
-               Vector4 color = new Vector4(1,1,1,1);
-               int texture;
+               public int vsId, fsId, gsId, pgmId, mvpLocation;
+
+               Matrix4 mvp = Matrix4.Identity;
                #endregion
 
 
@@ -131,38 +100,59 @@ namespace Crow
                        set { _geomSource = value; }
                }
 
-               public Matrix4 ProjectionMatrix{
-                       set { projectionMat = value; }
-                       get { return projectionMat; }
+               public virtual Matrix4 MVP{
+                       set { mvp = value; }
+                       get { return mvp; }
                }
-               public Matrix4 ModelViewMatrix {
-                       set { modelViewMat = value; }
-                       get { return modelViewMat; }
+               #endregion
+
+               #region Public functions
+               /// <summary>
+               /// configure sources and compile
+               /// </summary>
+               public virtual void Init()
+               {
+                       Compile ();
                }
-               public Matrix4 ModelMatrix {
-                       set { modelMat = value; }
-                       get { return modelMat; }
+               public void Reload(){
+                       loadSourcesFiles ();
+                       Compile ();
                }
-               public Vector4 Color {
-                       set { color = value; }
-                       get { return color; }
+               public void SetSource(ShaderType shaderType, string _source){
+                       switch (shaderType) {
+                       case ShaderType.FragmentShader:
+                               fragSource = _source;
+                               return;
+                       case ShaderType.VertexShader:
+                               vertSource = _source;
+                               return;
+                       case ShaderType.GeometryShader:
+                               geomSource = _source;
+                               return;
+                       }
                }
-
-               public int Texture {
-                       get { return texture; }
-                       set { texture = value; }
+               public string GetSource(ShaderType shaderType){
+                       switch (shaderType) {
+                       case ShaderType.FragmentShader:
+                               return fragSource;
+                       case ShaderType.VertexShader:
+                               return vertSource;
+                       case ShaderType.GeometryShader:
+                               return geomSource;
+                       }
+                       return "";
                }
-
-               #endregion
-
-               void updateNormalMatrix()
-               {
-                       Matrix4 normalMat = (modelViewMat).Inverted();
-                       normalMat.Transpose ();
-                       GL.UniformMatrix4 (normalLocation, false, ref normalMat);
+               public string GetSourcePath(ShaderType shaderType){
+                       switch (shaderType) {
+                       case ShaderType.FragmentShader:
+                               return FragSourcePath;
+                       case ShaderType.VertexShader:
+                               return VertSourcePath;
+                       case ShaderType.GeometryShader:
+                               return GeomSourcePath;
+                       }
+                       return "";
                }
-
-               #region Public functions
                public virtual void Compile()
                {
                        Dispose ();
@@ -228,31 +218,16 @@ namespace Crow
                }
                protected virtual void GetUniformLocations()
                {
-                       projectionLocation = GL.GetUniformLocation(pgmId, "Projection");
-                       modelViewLocation = GL.GetUniformLocation(pgmId, "ModelView");
-                       modelLocation = GL.GetUniformLocation(pgmId, "Model");
-                       normalLocation = GL.GetUniformLocation(pgmId, "Normal");
-                       colorLocation = GL.GetUniformLocation (pgmId, "color");
-
+                       mvpLocation = GL.GetUniformLocation(pgmId, "mvp");
                }
                protected virtual void BindSamplesSlots(){
                        GL.Uniform1(GL.GetUniformLocation (pgmId, "tex"), 0);
                }
-
+               public void SetMVP(Matrix4 _mvp){
+                       GL.UniformMatrix4(mvpLocation, false, ref _mvp);
+               }
                public virtual void Enable(){
                        GL.UseProgram (pgmId);
-
-                       GL.UniformMatrix4(projectionLocation, false, ref projectionMat);
-                       GL.UniformMatrix4 (modelLocation, false, ref modelMat);
-                       GL.UniformMatrix4 (modelViewLocation, false, ref modelViewMat);
-                       updateNormalMatrix ();
-                       GL.Uniform4 (colorLocation, color);
-
-                       if (texture < 0)
-                               return;
-
-                       GL.ActiveTexture (TextureUnit.Texture0);
-                       GL.BindTexture(TextureTarget.Texture2D, texture);
                }
                public virtual void Disable(){
                        GL.UseProgram (0);
@@ -271,6 +246,36 @@ namespace Crow
                }
                #endregion
 
+               void loadSourcesFiles(){
+                       Stream s;
+
+                       if (!string.IsNullOrEmpty (VertSourcePath)) {
+                               s = Crow.Interface.GetStreamFromPath (VertSourcePath);
+                               if (s != null) {
+                                       using (StreamReader sr = new StreamReader (s)) {
+                                               vertSource = sr.ReadToEnd ();
+                                       }
+                               }
+                       }
+
+                       if (!string.IsNullOrEmpty (FragSourcePath)) {
+                               s = Crow.Interface.GetStreamFromPath (FragSourcePath);
+                               if (s != null) {
+                                       using (StreamReader sr = new StreamReader (s)) {
+                                               fragSource = sr.ReadToEnd ();
+                                       }
+                               }
+                       }
+
+                       if (!string.IsNullOrEmpty (GeomSourcePath)) {
+                               s = Crow.Interface.GetStreamFromPath (GeomSourcePath);
+                               if (s != null) {
+                                       using (StreamReader sr = new StreamReader (s)) {
+                                               geomSource = sr.ReadToEnd ();
+                                       }
+                               }
+                       }                       
+               }
                void compileShader(int shader, string source)
                {
                        GL.ShaderSource(shader, source);
@@ -288,10 +293,14 @@ namespace Crow
                                Debug.WriteLine(source);
                        }
                }
+               public override string ToString ()
+               {
+                       return string.Format ("{0} {1} {2}", VertSourcePath, FragSourcePath, GeomSourcePath);
+               }
 
                #region IDisposable implementation
                public virtual void Dispose ()
-               {
+               {                       
                        if (GL.IsProgram (pgmId))
                                GL.DeleteProgram (pgmId);
 
@@ -305,3 +314,4 @@ namespace Crow
                #endregion
        }
 }
+
diff --git a/OTKCrow/OpenGL/TexturedShader.cs b/OTKCrow/OpenGL/TexturedShader.cs
deleted file mode 100644 (file)
index 9e29b69..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-using System;
-using OpenTK.Graphics.OpenGL;
-
-namespace Crow
-{
-       public class TexturedShader : Shader
-       {
-               public TexturedShader ()
-               {
-
-                       fragSource = @"
-                               #version 130
-                               precision highp float;
-
-                               uniform sampler2D tex;
-
-                               in vec2 texCoord;
-                               out vec4 out_frag_color;
-
-                               void main(void)
-                               {
-                                       out_frag_color = texture( tex, texCoord);
-                               }";
-
-                       Compile ();
-
-               }
-
-               protected override void BindSamplesSlots ()
-               {
-                       base.BindSamplesSlots ();
-
-                       GL.Uniform1(GL.GetUniformLocation (pgmId, "stencil"),1);
-               }
-               public override void Enable ()
-               {
-                       base.Enable ();
-
-               }
-       }
-}
diff --git a/OTKCrow/OpenGL/VertexArrayObject.cs b/OTKCrow/OpenGL/VertexArrayObject.cs
deleted file mode 100644 (file)
index c7b685d..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-using System;
-using OpenTK;
-using OpenTK.Graphics.OpenGL;
-
-namespace Crow
-{
-       public class VertexArrayObject : IDisposable
-       {
-               public int vaoHandle,
-               positionVboHandle,
-               texVboHandle,
-               eboHandle;
-
-               Vector2[] positionVboData;
-               public int[] indicesVboData;
-               Vector2[] texVboData;
-
-               public VertexArrayObject (Vector2[] _positions, Vector2[] _texCoord, int[] _indices)
-               {
-                       positionVboData = _positions;
-                       texVboData = _texCoord;
-                       indicesVboData = _indices;
-
-                       CreateVBOs ();
-                       CreateVAOs ();
-               }
-
-               void deleteVAOs()
-               {
-                       GL.DeleteBuffer (positionVboHandle);
-                       GL.DeleteBuffer (texVboHandle);
-                       GL.DeleteBuffer (eboHandle);
-                       GL.DeleteVertexArray (vaoHandle);
-               }
-
-               void CreateVBOs()
-               {
-                       positionVboHandle = GL.GenBuffer();
-                       GL.BindBuffer(BufferTarget.ArrayBuffer, positionVboHandle);
-                       GL.BufferData<Vector2>(BufferTarget.ArrayBuffer,
-                               new IntPtr(positionVboData.Length * Vector2.SizeInBytes),
-                               positionVboData, BufferUsageHint.StaticDraw);
-
-                       texVboHandle = GL.GenBuffer();
-                       GL.BindBuffer(BufferTarget.ArrayBuffer, texVboHandle);
-                       GL.BufferData<Vector2>(BufferTarget.ArrayBuffer,
-                               new IntPtr(texVboData.Length * Vector2.SizeInBytes),
-                               texVboData, BufferUsageHint.StaticDraw);
-                       //
-                       eboHandle = GL.GenBuffer();
-                       GL.BindBuffer(BufferTarget.ElementArrayBuffer, eboHandle);
-                       GL.BufferData(BufferTarget.ElementArrayBuffer,
-                               new IntPtr(sizeof(uint) * indicesVboData.Length),
-                               indicesVboData, BufferUsageHint.StaticDraw);
-
-                       GL.BindBuffer(BufferTarget.ArrayBuffer, 0);
-                       GL.BindBuffer(BufferTarget.ElementArrayBuffer, 0);
-               }
-
-               void CreateVAOs()
-               {
-                       vaoHandle = GL.GenVertexArray();
-                       GL.BindVertexArray(vaoHandle);
-
-                       GL.EnableVertexAttribArray(0);
-                       GL.BindBuffer(BufferTarget.ArrayBuffer, positionVboHandle);
-                       GL.VertexAttribPointer(0, 2, VertexAttribPointerType.Float, true, Vector2.SizeInBytes, 0);
-
-                       GL.EnableVertexAttribArray(1);
-                       GL.BindBuffer(BufferTarget.ArrayBuffer, texVboHandle);
-                       GL.VertexAttribPointer(1, 2, VertexAttribPointerType.Float, true, Vector2.SizeInBytes, 0);
-
-                       GL.BindBuffer(BufferTarget.ElementArrayBuffer, eboHandle);
-
-                       GL.BindVertexArray(0);
-               }
-
-               public void Render(PrimitiveType _primitiveType){
-                       GL.BindVertexArray(vaoHandle);
-                       GL.DrawElements(_primitiveType, indicesVboData.Length,
-                               DrawElementsType.UnsignedInt, IntPtr.Zero);
-                       GL.BindVertexArray (0);
-               }
-
-
-               #region IDisposable implementation
-               public void Dispose ()
-               {
-                       deleteVAOs ();
-               }
-               #endregion
-       }
-}
diff --git a/OTKCrow/OpenGL/vaoMesh.cs b/OTKCrow/OpenGL/vaoMesh.cs
new file mode 100644 (file)
index 0000000..b076362
--- /dev/null
@@ -0,0 +1,145 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Collections.Generic;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+//using System.Drawing;
+using System.Drawing.Imaging;
+using System.IO;
+using System.Threading;
+using System.Diagnostics;
+using System.Linq;
+
+namespace Crow
+{
+       public class vaoMesh : IDisposable
+       {
+               public int vaoHandle,
+               positionVboHandle,
+               texVboHandle,
+               eboHandle;
+
+               public Vector3[] positions;
+               public Vector2[] texCoords;
+               public int[] indices;
+
+               public vaoMesh()
+               {
+               }
+
+               public vaoMesh (Vector3[] _positions, Vector2[] _texCoord, int[] _indices)
+               {
+                       positions = _positions;
+                       texCoords = _texCoord;
+                       indices = _indices;
+
+                       CreateVBOs ();
+                       CreateVAOs ();
+               }
+
+               public vaoMesh (float x, float y, float z, float width, float height, float TileX = 1f, float TileY = 1f)
+               {
+                       positions =
+                               new Vector3[] {
+                               new Vector3 (x - width / 2, y + height / 2, z),
+                               new Vector3 (x - width / 2, y - height / 2, z),
+                               new Vector3 (x + width / 2, y + height / 2, z),
+                               new Vector3 (x + width / 2, y - height / 2, z)
+                       };
+                       texCoords =     new Vector2[] {
+                               new Vector2 (0, TileY),
+                               new Vector2 (0, 0),
+                               new Vector2 (TileX, TileY),
+                               new Vector2 (TileX, 0)
+                       };
+                       indices = new int[] { 0, 1, 2, 3 };
+
+                       CreateVBOs ();
+                       CreateVAOs ();
+               }
+               public void CreateBuffers(){
+                       CreateVBOs ();
+                       CreateVAOs ();
+               }
+               protected void CreateVBOs()
+               {
+                       positionVboHandle = GL.GenBuffer();
+                       GL.BindBuffer(BufferTarget.ArrayBuffer, positionVboHandle);
+                       GL.BufferData<Vector3>(BufferTarget.ArrayBuffer,
+                               new IntPtr(positions.Length * Vector3.SizeInBytes),
+                               positions, BufferUsageHint.StaticDraw);
+
+                       if (texCoords != null) {
+                               texVboHandle = GL.GenBuffer ();
+                               GL.BindBuffer (BufferTarget.ArrayBuffer, texVboHandle);
+                               GL.BufferData<Vector2> (BufferTarget.ArrayBuffer,
+                                       new IntPtr (texCoords.Length * Vector2.SizeInBytes),
+                                       texCoords, BufferUsageHint.StaticDraw);
+                       }
+
+                       GL.BindBuffer(BufferTarget.ArrayBuffer, 0);
+
+                       if (indices != null) {
+                               eboHandle = GL.GenBuffer ();
+                               GL.BindBuffer (BufferTarget.ElementArrayBuffer, eboHandle);
+                               GL.BufferData (BufferTarget.ElementArrayBuffer,
+                                       new IntPtr (sizeof(uint) * indices.Length),
+                                       indices, BufferUsageHint.StaticDraw);
+                               GL.BindBuffer(BufferTarget.ElementArrayBuffer, 0);
+                       }
+               }
+               protected void CreateVAOs()
+               {
+                       vaoHandle = GL.GenVertexArray();
+                       GL.BindVertexArray(vaoHandle);
+
+                       GL.EnableVertexAttribArray(0);
+                       GL.BindBuffer(BufferTarget.ArrayBuffer, positionVboHandle);
+                       GL.VertexAttribPointer(0, 3, VertexAttribPointerType.Float, true, Vector3.SizeInBytes, 0);
+
+                       if (texCoords != null) {
+                               GL.EnableVertexAttribArray (1);
+                               GL.BindBuffer (BufferTarget.ArrayBuffer, texVboHandle);
+                               GL.VertexAttribPointer (1, 2, VertexAttribPointerType.Float, true, Vector2.SizeInBytes, 0);
+                       }
+                       if (indices != null)
+                               GL.BindBuffer(BufferTarget.ElementArrayBuffer, eboHandle);
+
+                       GL.BindVertexArray(0);
+               }
+
+               public void Render(BeginMode _primitiveType){
+                       GL.BindVertexArray(vaoHandle);
+                       if (indices == null)
+                               GL.DrawArrays (_primitiveType, 0, positions.Length);
+                       else
+                               GL.DrawElements(_primitiveType, indices.Length,
+                                       DrawElementsType.UnsignedInt, IntPtr.Zero);
+                       GL.BindVertexArray (0);
+               }
+               public void Render(BeginMode _primitiveType, int[] _customIndices){
+                       GL.BindVertexArray(vaoHandle);
+                       GL.DrawElements(_primitiveType, _customIndices.Length,
+                               DrawElementsType.UnsignedInt, _customIndices);
+                       GL.BindVertexArray (0);
+               }
+               public void Render(BeginMode _primitiveType, int instances){
+
+                       GL.BindVertexArray(vaoHandle);
+                       GL.DrawElementsInstanced(_primitiveType, indices.Length,
+                               DrawElementsType.UnsignedInt, IntPtr.Zero, instances);
+                       GL.BindVertexArray (0);
+               }
+
+               #region IDisposable implementation
+               public void Dispose ()
+               {
+                       GL.DeleteBuffer (positionVboHandle);
+                       GL.DeleteBuffer (texVboHandle);
+                       GL.DeleteBuffer (eboHandle);
+                       GL.DeleteVertexArray (vaoHandle);
+               }
+               #endregion
+
+       }
+}
\ No newline at end of file
diff --git a/OTKCrow/OpenTK.dll.config b/OTKCrow/OpenTK.dll.config
deleted file mode 100644 (file)
index 7098d39..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<configuration>
-  <dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
-  <dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
-  <dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
-  <dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
-  <dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
-  <dllmap os="linux" dll="libX11" target="libX11.so.6"/>
-  <dllmap os="linux" dll="libXi" target="libXi.so.6"/>
-  <dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
-  <dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
-  <dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
-  <dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
-  <dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
-  <dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
-  <dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
-  <dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
-  <dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
-  <!-- XQuartz compatibility (X11 on Mac) -->
-  <dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
-  <dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
-  <dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
-  <dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
-  <dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
-  <dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
-</configuration>
index 60fa8b89e4e0d68620e1faa775f28c082f7182fa..61683e3468ece8aa300e9ef98ac097caf044ed87 100644 (file)
@@ -141,12 +141,12 @@ namespace Crow
                }
                void CrowInterface_MouseCursorChanged (object sender, MouseCursorChangedEventArgs e)
                {
-                       this.Cursor = new MouseCursor(
-                               (int)e.NewCursor.Xhot,
-                               (int)e.NewCursor.Yhot,
-                               (int)e.NewCursor.Width,
-                               (int)e.NewCursor.Height,
-                               e.NewCursor.data);
+//                     this.Cursor = new MouseCursor(
+//                             (int)e.NewCursor.Xhot,
+//                             (int)e.NewCursor.Yhot,
+//                             (int)e.NewCursor.Width,
+//                             (int)e.NewCursor.Height,
+//                             e.NewCursor.data);
                }
 
                #region Events
@@ -164,7 +164,7 @@ namespace Crow
                #region graphic context
                int texID;
                Tetra.Shader shader;
-               public static GGL.vaoMesh quad;
+               public static Crow.vaoMesh quad;
 
                void createContext()
                {
@@ -187,8 +187,9 @@ namespace Crow
                }
                void OpenGLDraw()
                {
-                       bool blend = GL.GetBoolean (GetPName.Blend);
-                       bool depthTest = GL.GetBoolean (GetPName.DepthTest);
+                       bool blend, depthTest;
+                       GL.GetBoolean (GetPName.Blend, out blend);
+                       GL.GetBoolean (GetPName.DepthTest, out depthTest);
                        GL.Enable (EnableCap.Blend);
                        GL.Disable (EnableCap.DepthTest);
 
@@ -204,7 +205,7 @@ namespace Crow
                                        CrowInterface.IsDirty = false;
                                }
                        }
-                       quad.Render (PrimitiveType.TriangleStrip);
+                       quad.Render (BeginMode.TriangleStrip);
                        GL.BindTexture(TextureTarget.Texture2D, 0);
                        shader.Disable ();
                        if (!blend)
@@ -247,7 +248,7 @@ namespace Crow
                        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);
+                       quad = new Crow.vaoMesh (0, 0, 0, 1, 1, 1, -1);
                }
 
                protected override void OnUpdateFrame(FrameEventArgs e)
@@ -283,8 +284,8 @@ namespace Crow
                        base.OnResize (e);
                        CrowInterface.ProcessResize(
                                new Rectangle(
-                               this.ClientRectangle.X,
-                               this.ClientRectangle.Y,
+                               0,
+                               0,
                                this.ClientRectangle.Width,
                                this.ClientRectangle.Height));
                        createContext ();
index 6e6f39d494e0764c0f3c71473b4a80a2fd955259..25c974be4eb7ad369650d608b3945c825f39a79e 100644 (file)
@@ -1,4 +1,4 @@
 ï»¿<?xml version="1.0" encoding="utf-8"?>
 <packages>
-  <package id="OpenTK" version="1.1.2225.0" targetFramework="net45" />
+  <package id="OpenTK" version="1.1.2349.61993" targetFramework="net45" />
 </packages>
\ No newline at end of file
index f76082e134a48e5207acf0213ac168818259206b..c746e703f43ab28d12ff31f52ebb014f6a2117fb 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,66 +1,34 @@
-CROW
-=====
+CROW [![NuGet Version and Downloads](https://buildstats.info/nuget/Crow.dll)](https://www.nuget.org/packages/Crow.dll/)
 
-CROW stands for 'Collaborative Radiant Open Widgets' which is a pure c# widget toolkit with templates and bindings.
-Running under Mono, With multi-platform libraries (Cairo, OpenTK) it should run on any target.
 
-The main advantage of this toolkit is it's simplicity and it's coherence. Thanks to the job done by 
-OpenTK team on linux drm/kms support, Crow may run without a X server directely in console.
+**CROW** is a pure **C#** widget toolkit originaly developed for easy developement with OpenTK.
+Running under Mono, With multi-platform libraries it should run on any target.
+
+**CROW** use **Mono.Cairo** for rendering. The resulting widgets are outputed to an in memory bitmap
+and a clipping system ensure only dirty region are updated. Depending on the graphical context, this bitmap
+may be used as Texture, Pixbuf, etc...
+
+**Crow** has full transparency support, but a fast opaque rendering queue exist for heavy critical application.
+
+Thanks to the job done by OpenTK team on linux drm/kms support, Crow may run without a X server directely in console.
 
-Graphic Rendering stack could easily be changed by implementing ICrowHost, and a custom (and lighter) opengl rendering replacement for cairo is on the stack.
 
 FEATURES
 ========
 
-- Use OpenTK as top container for device abstraction layer by default, (other container: GTK, GDK)
-- Curent drawing routines use Mono.Cairo
-- Allow easy creation of XAML like interface under linux directely in console mode, without X
-  It only required Mono with cairo libraries, OpenTK, Mesa, GBM and DRM libraries.
-- Templated controls, with dynamic binding.
+- **XML** interface definition.
+- Templates and styling
+- Dynamic binding system with code injection.
 - Inlined delegate in XML
 
 Example
 -------
 
 ```
-<Window Width="800" Height="600" Title="Decks">        
-       <HorizontalStack>
-               <ListBox Height="0" Width="150" Background="0,5;0,5;0,5;0,5" Name="deckList"
-                       Data="{DeckList}" HorizontalAlignment="Left" ValueChanged="onDeckListValueChange"
-                       ItemTemplate="#Magic3D.ui.DeckItemTemplate.goml">
-                       <Template>
-                               <Border BorderWidth="1" MinimumSize="0;100" Height="{TemplatedHeight}" Width="{TemplatedWidth}">
-                                       <HorizontalStack Margin="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}">
-                                               <Scroller  Name="scroller1" Height="{TemplatedHeight}" Width="{TemplatedWidth}" 
-                                                Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Scroll}">
-                                                       <VerticalStack Width="{TemplatedWidth}" Height="-1" Name="List" Margin="0" VerticalAlignment="Top"/>
-                                               </Scroller>
-                                               <Scrollbar Name="scrollbar1" Scroll="{../scroller1.ScrollY}" MaximumScroll="{../scroller1.MaximumScroll}"
-                                                       Orientation="Vertical" Width="10" Height="{TemplatedHeight}" />
-                                       </HorizontalStack>
-                               </Border>
-                       </Template>
-               </ListBox>
-               <HorizontalStack Width="0" Height="0" Background="DimGray" Name="hsDeck"/>
-       </HorizontalStack>
-</Window>
 ```
 Building
 ========
 
-#####Build latest OpenTK:
-```
-git clone https://github.com/opentk/opentk   # Download source code from git
-cd opentk                                    # Enter the source directory
-msbuild /p:Configuration=Release OpenTK.sln  # Build on .Net (Windows)
-xbuild  /p:Configuration=Release OpenTK.sln  # Build on Mono (Linux / Mac OS X)
-```
-#####Install Cairo and RSVG cli bindings
-######On Debian:
-
-```
-sudo apt-get install libmono-cairo4.0-cil libglib3.0-cil librsvg2-2.18-cil
-```
 #####Build Crow
 ```
 git clone https://github.com/jpbruyere/Crow.git        # Download source code from git
diff --git a/Styles/Slider.style b/Styles/Slider.style
new file mode 100644 (file)
index 0000000..e767555
--- /dev/null
@@ -0,0 +1,4 @@
+Background = vgradient|0:Black|0,1:Gray|0,9:Gray|1:LightGray
+Foreground = Gray
+Focusable = true
+Fit = true
diff --git a/Styles/TabItem.style b/Styles/TabItem.style
new file mode 100644 (file)
index 0000000..9562848
--- /dev/null
@@ -0,0 +1,2 @@
+Focusable = true
+CacheEnabled = false
index 1383d029ecdbeaa28c193280c31a04e5b53b25c1..316c73c2733442689215a30f70ba6962aedfc39b 100644 (file)
@@ -89,16 +89,24 @@ namespace testOTK
                {
                        base.OnLoad (e);
                        //this.AddWidget(new test4());
-                       KeyboardKeyDown += GOLIBTests_KeyboardKeyDown1;;
-
-                       testFiles = Directory.GetFiles(@"Interfaces/Stack", "*.crow").ToArray();
-                       //testFiles = Directory.GetFiles(@"Interfaces/Stack", "*.crow").ToArray();
-                       //testFiles = Directory.GetFiles(@"Interfaces/GraphicObject", "*.crow").Concat(testFiles).ToArray();
+                       KeyboardKeyDown += GOLIBTests_KeyboardKeyDown1;
+
+                       //testFiles = new string [] { @"Interfaces/Divers/testBind0.crow" };
+                       testFiles = new string [] { @"Interfaces/Divers/testCombobox.crow" };
+                       testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
+                       //testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/basicTests", "*.crow")).ToArray ();
+                       testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
+                       testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Group", "*.crow")).ToArray ();
+                       testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Stack", "*.crow")).ToArray ();
+                       testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Splitter", "*.crow")).ToArray ();
+                       testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Expandable", "*.crow")).ToArray ();
+                       testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray ();
 
                        //testFiles = Directory.GetFiles(@"Interfaces", "*.crow").Concat(testFiles).ToArray();
                        this.Title = testFiles [idx];
-                       GraphicObject obj = CrowInterface.LoadInterface(testFiles[idx]);
-                       obj.DataSource = this;
+                       CrowInterface.LoadInterface(testFiles[idx]).DataSource = this;
+
+                       //CrowInterface.LoadInterface ("#Tests.ui.fps.crow").DataSource = this; 
 
                }
                void GOLIBTests_KeyboardKeyDown1 (object sender, OpenTK.Input.KeyboardKeyEventArgs e)
@@ -124,23 +132,6 @@ namespace testOTK
                        obj.DataSource = this;
                }
 
-//             protected override void OnUpdateFrame (FrameEventArgs e)
-//             {
-//                     //if (frameCpt % 8 == 0)
-//                             base.OnUpdateFrame (e);
-//
-//                     fps = (int)RenderFrequency;
-//
-//
-//                     if (frameCpt > 50) {
-//                             resetFps ();
-//                             frameCpt = 0;
-//                             GC.Collect();
-//                             GC.WaitForPendingFinalizers();
-//                             NotifyValueChanged("memory", GC.GetTotalMemory (false).ToString());
-//                     }
-//                     frameCpt++;
-//             }
                void onButClick(object send, MouseButtonEventArgs e)
                {
                        Console.WriteLine ("button clicked:" + send.ToString());
@@ -161,16 +152,16 @@ namespace testOTK
                        //win.KeyPressEvent += win.Win_KeyPressEvent;
                }
 
-               void Win_KeyPressEvent (object o, Gtk.KeyPressEventArgs args)
-               {
-                       CrowInterface.ClearInterface ();
-                       idx++;
-                       if (idx == testFiles.Length)
-                               idx = 0;
-                       this.Title = testFiles [idx];
-                       GraphicObject obj = CrowInterface.LoadInterface(testFiles[2]);
-                       obj.DataSource = this;
-               }
+//             void Win_KeyPressEvent (object o, Gtk.KeyPressEventArgs args)
+//             {
+//                     CrowInterface.ClearInterface ();
+//                     idx++;
+//                     if (idx == testFiles.Length)
+//                             idx = 0;
+//                     this.Title = testFiles [idx];
+//                     GraphicObject obj = CrowInterface.LoadInterface(testFiles[2]);
+//                     obj.DataSource = this;
+//             }
 
 
 
diff --git a/Tests/OTKCrow.cs b/Tests/OTKCrow.cs
new file mode 100644 (file)
index 0000000..1dee2f0
--- /dev/null
@@ -0,0 +1,45 @@
+#define MONO_CAIRO_DEBUG_DISPOSE
+
+
+using System;
+using System.Runtime.InteropServices;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+
+using System.Diagnostics;
+
+//using GGL;
+using Crow;
+using System.Threading;
+using System.Collections.Generic;
+using System.Linq;
+using System.IO;
+
+
+namespace testCrowOTK
+{
+       class CrowTest : OpenTKGameWindow
+       {
+               public CrowTest ()
+                       : base(800, 600,"Crow Test with OpenTK")
+               {
+                       VSync = VSyncMode.Off;
+                       Interface.CurrentInterface = CrowInterface;
+               }
+
+
+               protected override void OnLoad (EventArgs e)
+               {
+                       base.OnLoad (e);
+
+                       CrowInterface.LoadInterface ("#Tests.ui.test.crow").DataSource = this;  
+               }
+
+               [STAThread]
+               static void Main ()
+               {
+                       CrowTest win = new CrowTest ();
+                       win.Run (30);
+               }
+       }
+}
\ No newline at end of file
index eba8a6ee3c6950eb502dd285c99bad0a9837e887..29862e56982e355c4799a24059139b50d7346f5e 100644 (file)
@@ -8,7 +8,7 @@
     <OutputType>Exe</OutputType>
     <RootNamespace>Tests</RootNamespace>
     <AssemblyName>Tests</AssemblyName>
-    <StartupObject>Tests.GLCrow</StartupObject>
+    <StartupObject>testCrowOTK.CrowTest</StartupObject>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <OutputPath>$(SolutionDir)/build/$(Configuration)</OutputPath>
     <IntermediateOutputPath>$(SolutionDir)/build/obj/$(Configuration)</IntermediateOutputPath>
     <WarningLevel>4</WarningLevel>
     <ConsolePause>false</ConsolePause>
     <DefineConstants>DEBUG;TRACE;MEASURE_TIME</DefineConstants>
+    <IntermediateOutputPath>..\build\obj\Debug</IntermediateOutputPath>
+    <OutputPath>..\build\Debug</OutputPath>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <WarningLevel>0</WarningLevel>
     <ConsolePause>false</ConsolePause>
+    <IntermediateOutputPath>..\build\obj\Release</IntermediateOutputPath>
+    <OutputPath>..\build\Release</OutputPath>
   </PropertyGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <ItemGroup>
     <Reference Include="System.Data" />
     <Reference Include="System.Xml" />
     <Reference Include="System.Drawing" />
-    <Reference Include="cairo-sharp, Version=1.10.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756">
-      <Package>gtk-sharp-3.0</Package>
-    </Reference>
-    <Reference Include="gio-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
-      <Package>gio-sharp-3.0</Package>
-    </Reference>
-    <Reference Include="glib-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
-      <Package>glib-sharp-3.0</Package>
-    </Reference>
-    <Reference Include="gtk-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
-      <Package>gtk-sharp-3.0</Package>
-    </Reference>
-    <Reference Include="atk-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
-      <Package>gtk-sharp-3.0</Package>
+    <Reference Include="OpenTK">
+      <HintPath>..\packages\OpenTK.1.1.2349.61993\lib\NET40\OpenTK.dll</HintPath>
     </Reference>
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Interfaces\testBorder.goml.cs">
-      <LogicalName></LogicalName>
-    </Compile>
-    <Compile Include="GLCrow.cs">
-      <LogicalName></LogicalName>
-    </Compile>
+    <Compile Include="Interfaces\testBorder.goml.cs" />
+    <Compile Include="GOLIBTestsOTK.cs" />
+    <Compile Include="OTKCrow.cs" />
   </ItemGroup>
   <ItemGroup>
     <None Include="image\u.svg">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\log.xml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\testMeter.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\tmpMembers.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\itemTmp.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\tmpDirItem.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
-    </None>
-    <None Include="GOLIBTests.cs">
-      <LogicalName></LogicalName>
     </None>
+    <None Include="GOLIBTests.cs" />
     <None Include="Interfaces\basicTests\0.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\basicTests\1.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\basicTests\2.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\basicTests\4.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\basicTests\5.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\basicTests\6.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\basicTests\7.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\GraphicObject\0.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\GraphicObject\1.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\GraphicObject\2.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Container\0.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Container\1.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Container\2.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Stack\0.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Stack\1.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Stack\2.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Stack\3.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Container\3.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Group\0.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Group\1.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Group\2.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Group\3.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Group\4.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Stack\0h.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Stack\1h.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Stack\2h.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Stack\3h.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Stack\4.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\2.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\4.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\5.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\6.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\clip0.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\clip1.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\clip2.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\clip3.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\clip4.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\fps.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\test_Listbox.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\test_stack.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\test0.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\test1.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\test1.1.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\test1.2.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\test2.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\test2WayBinding.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\test3.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\test5.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\test7.crow">
       <LogicalName>Tests.Interfaces.test7.goml</LogicalName>
     </None>
     <None Include="Interfaces\Divers\testAll.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\testBorder.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\testButton.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\testCheckbox.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\testCombobox.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\testContainer.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\testGrid.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\testGroupBox.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\testHStack.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\testPopper.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\testRadioButton.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\testScrollbar.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\testSpinner.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\testStacks.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\testTextBox.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\testWindow.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\testWindow2.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Divers\testWindow3.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Nouveau dossier\testColorList.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Nouveau dossier\test4.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Nouveau dossier\test6.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Nouveau dossier\test4.1.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Nouveau dossier\testMsgBox.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Nouveau dossier\testOutOfClipUpdate.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Nouveau dossier\testFileDialog.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Nouveau dossier\testImage.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Nouveau dossier\testDirViewer.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Nouveau dossier\testTabView.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Nouveau dossier\testTypeViewer.goml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Nouveau dossier\testLabel.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Nouveau dossier\testRadioButton2.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Expandable\1.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Expandable\0.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Expandable\7.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Expandable\2.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Nouveau dossier\testTreeView.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
     </None>
     <None Include="Interfaces\Splitter\1.crow">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-      <LogicalName></LogicalName>
-    </None>
-    <None Include="OpenTK.dll.config">
-      <LogicalName></LogicalName>
-    </None>
-    <None Include="GOLIBTestsOTK.cs">
-      <LogicalName></LogicalName>
     </None>
+    <None Include="OpenTK.dll.config" />
+    <None Include="packages.config" />
+    <None Include="main.cs" />
+    <None Include="GLCrow.cs" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="Interfaces\" />
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </EmbeddedResource>
     <EmbeddedResource Include="Interfaces\TmpExpandable.goml" />
-    <EmbeddedResource Include="ui\fps.crow" />
     <EmbeddedResource Include="ui\tmpWindow.crow" />
+    <EmbeddedResource Include="ui\test.crow" />
+    <EmbeddedResource Include="ui\LabelButton.style" />
+    <EmbeddedResource Include="ui\Popper.template" />
+    <EmbeddedResource Include="ui\MenuItem.style" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\Crow.csproj">
       <Project>{C2980F9B-4798-4C05-99E2-E174810F7C7B}</Project>
       <Name>Crow</Name>
     </ProjectReference>
-    <ProjectReference Include="..\GLCrow\GLCrow.csproj">
-      <Project>{66376B95-9351-4A63-B920-F4BB53FEF0E2}</Project>
-      <Name>GLCrow</Name>
-    </ProjectReference>
-    <ProjectReference Include="..\..\..\src\Pencil.Gaming\Pencil.Gaming\Pencil.Gaming.csproj">
-      <Project>{DDB6DB6D-E5DE-4BDB-8AC8-26DF800E9FF0}</Project>
-      <Name>Pencil.Gaming</Name>
+    <ProjectReference Include="..\OTKCrow\OTKCrow.csproj">
+      <Project>{350D4F49-9901-4998-9903-BCA7D48DA58C}</Project>
+      <Name>OTKCrow</Name>
     </ProjectReference>
   </ItemGroup>
 </Project>
diff --git a/Tests/main.cs b/Tests/main.cs
new file mode 100644 (file)
index 0000000..5ec562e
--- /dev/null
@@ -0,0 +1,467 @@
+#define MONO_CAIRO_DEBUG_DISPOSE
+
+
+using System;
+using System.Runtime.InteropServices;
+using OpenTK;
+using OpenTK.Graphics.OpenGL;
+using OpenTK.Input;
+
+using System.Diagnostics;
+
+//using GGL;
+using Crow;
+using System.Threading;
+using GGL;
+using System.Collections.Generic;
+using System.IO;
+
+
+namespace Opuz2015
+{
+       public enum GameState { Init, CutStart, CutFinished, Play, Finished};
+
+       class MainWin : OpenTKGameWindow, IBindable
+       {
+               #region IBindable implementation
+               List<Binding> bindings = new List<Binding> ();
+               public List<Binding> Bindings {
+                       get { return bindings; }
+               }
+               #endregion
+
+               #region  scene matrix and vectors
+               public static Matrix4 modelview;
+               public static Matrix4 projection;
+               public static int[] viewport = new int[4];
+
+               public float EyeDist { 
+                       get { return eyeDist; } 
+                       set { 
+                               eyeDist = value; 
+                               UpdateViewMatrix ();
+                       } 
+               }
+               public Vector3 vEyeTarget = new Vector3(0, 0, 0f);
+               public Vector3 vEye;
+               public Vector3 vLookInit = Vector3.Normalize(new Vector3(0.0f, -0.7f, 0.7f));
+               public Vector3 vLook = Vector3.Normalize(new Vector3(0.0f, -0.1f, 0.9f));  // Camera vLook Vector
+               public float zFar = 6000.0f;
+               public float zNear = 1.0f;
+               public float fovY = (float)Math.PI / 4;
+
+               float eyeDist = 1000f;
+               float eyeDistTarget = 1000f;
+               float MoveSpeed = 100.0f;
+               float RotationSpeed = 0.02f;
+               float ZoomSpeed = 2f;
+               float viewZangle, viewXangle;
+
+               public Vector4 vLight = new Vector4 (0.5f, 0.5f, -1f, 0f);
+               #endregion
+
+               #region GL
+               public static PuzzleShader mainShader;
+               static RenderCache mainCache;
+               public static bool RebuildCache = false;
+
+               //public static GameLib.EffectShader selMeshShader;
+
+
+               void initOpenGL()
+               {                       
+                       GL.ClearColor(0.0f, 0.0f, 0.2f, 1.0f);
+                       GL.DepthFunc(DepthFunction.Lequal);
+                       GL.Enable(EnableCap.CullFace);
+                       GL.CullFace (CullFaceMode.Back);
+
+                       GL.PrimitiveRestartIndex (uint.MaxValue);
+                       GL.Enable (EnableCap.PrimitiveRestart);
+                       GL.Enable (EnableCap.Blend);
+                       GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
+
+                       GL.Enable (EnableCap.SampleShading);
+                       GL.MinSampleShading (0.5f);
+
+                       mainShader = new PuzzleShader();
+
+                       //selMeshShader = new GameLib.EffectShader ("Opuz2015.shaders.Border");
+
+
+                       mainCache = new RenderCache (ClientSize);
+
+                       ErrorCode err = GL.GetError ();
+                       Debug.Assert (err == ErrorCode.NoError, "OpenGL Error");        
+
+               }
+               #endregion
+
+               #region Interface
+               GraphicObject mainMenu = null;
+               GraphicObject finishedMessage = null;
+               GraphicObject imgSelection = null;
+
+               void initInterface(){
+                       //special event handlers fired only if mouse not in interface objects
+                       //for scene mouse handling
+                       MouseMove += Mouse_Move;
+                       MouseButtonDown += Mouse_ButtonDown;
+                       MouseButtonUp += Mouse_ButtonUp;
+                       MouseWheelChanged += Mouse_WheelChanged;
+                       //KeyboardKeyDown += MainWin_KeyboardKeyDown;
+
+                       CrowInterface.LoadInterface("#Opuz2015.ui.fps.crow").DataSource = this;
+                       mainMenu = CrowInterface.LoadInterface("#Opuz2015.ui.MainMenu.goml");
+                       mainMenu.DataSource = this;
+                       mainMenu.Visible = false;
+
+                       Crow.CompilerServices.ResolveBindings (this.Bindings);
+                       mainMenu.Visible = true;
+               }
+               void showFinishedMsg(){
+                       if (finishedMessage != null)
+                               return;
+                       finishedMessage = CrowInterface.LoadInterface("#Opuz2015.ui.Finished.goml");
+                       finishedMessage.DataSource = this;
+               }
+               void onImageClick (object sender, Crow.MouseButtonEventArgs e){                 
+                       if (imgSelection == null) {
+                               imgSelection = CrowInterface.LoadInterface ("#Opuz2015.ui.ImageSelect.goml");
+                               imgSelection.DataSource = this;
+                       }
+                       imgSelection.Visible = true;
+                       mainMenu.Visible = false;
+               }
+               void onSelectedImageChanged(object sender, SelectionChangeEventArgs e){
+                       mainMenu.Visible = true;
+                       imgSelection.Visible = false;
+                       ImagePath = e.NewValue.ToString();
+               }
+               void onCutPuzzle (object sender, Crow.MouseButtonEventArgs e)
+               {
+                       mainMenu.Visible = false;
+                       currentState = GameState.CutStart;
+               }
+               void onButQuitClick (object sender, Crow.MouseButtonEventArgs e){
+                       closeGame ();
+
+               }
+               void onBackToMainMenu (object sender, Crow.MouseButtonEventArgs e)
+               {
+                       closeCurrentPuzzle ();
+               }
+               #endregion
+
+               GameState currentState = GameState.Init;
+               Puzzle puzzle;
+
+               int nbPceX = 5;
+               int nbPceY = 3;
+               string imagePath = @"Images/0.jpg";
+               const float zSelPce = 8.0f;
+
+               bool puzzleIsReady { get { return puzzle == null ? false : puzzle.Ready; } }
+
+               public string[] Images
+               {
+                       get {
+                               return Directory.GetFiles(
+                                       System.IO.Path.GetDirectoryName(
+                                               System.Reflection.Assembly.GetExecutingAssembly().Location ) + "/Images");
+                       }
+               }
+               public int NbPceX {
+                       get {
+                               return nbPceX;
+                       }
+                       set {
+                               if (value == nbPceX)
+                                       return;
+                               nbPceX = value;
+                               NotifyValueChanged ("NbPceX", nbPceX);
+                       }
+               }
+               public int NbPceY {
+                       get { return nbPceY; }
+                       set { 
+                               if (value == nbPceY)
+                                       return;
+                               nbPceY = value;
+                               NotifyValueChanged ("NbPceY", nbPceY);
+                       }
+               }
+               public string ImagePath {
+                       get { return imagePath; }
+                       set {
+                               imagePath = value;
+                               NotifyValueChanged ("ImagePath", imagePath);
+                       }
+               }                       
+
+               void updateCache(){
+                       if (puzzle == null)
+                               return;
+                       if (!puzzle.Ready)
+                               return;
+                       
+                       mainCache.Bind (true);
+                       mainShader.Enable ();
+                       mainShader.Color = new Vector4 (1, 1, 1, 1);
+                       mainShader.ColorMultiplier = 1f;
+                       mainShader.Model = Matrix4.Identity;
+
+                       puzzle.Render ();
+
+                       GL.BindFramebuffer (FramebufferTarget.Framebuffer, 0);
+                       RebuildCache = false;
+               }
+
+               void closeGame(){
+                       if (puzzle != null)
+                               puzzle.Dispose();
+                       this.Quit (null,null);
+               }
+               void closeCurrentPuzzle(){
+                       currentState = GameState.Init;
+
+                       if (finishedMessage != null) {
+                               CrowInterface.DeleteWidget (finishedMessage);
+                               finishedMessage = null;
+                       }
+                       mainMenu.Visible = true;
+                       if (puzzle != null)
+                               puzzle.Dispose();
+                       puzzle = null;
+               }
+
+               #region OTK window overrides
+               protected override void OnLoad (EventArgs e)
+               {
+                       base.OnLoad (e);
+
+                       initInterface ();
+
+                       initOpenGL ();
+               }                       
+               public override void GLClear ()
+               {
+                       GL.ClearColor(0.2f, 0.2f, 0.4f, 0.0f);
+                       GL.Clear (ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
+               }
+               public override void OnRender (FrameEventArgs e)
+               {
+                       if (currentState < GameState.Play)
+                               return;
+                       RenderCache.EnableCacheShader ();
+
+                       mainCache.PaintCache ();
+
+                       mainShader.Enable ();
+                       puzzle.Render (puzzle.Selection.ToArray ());
+               }
+               protected override void OnResize (EventArgs e)
+               {
+                       base.OnResize (e);
+                       mainCache.CacheSize = ClientSize;
+                       UpdateViewMatrix();
+               }
+               protected override void OnUpdateFrame (FrameEventArgs e)
+               {
+                       base.OnUpdateFrame (e);
+
+                       switch (currentState) {
+                       case GameState.Init:
+                               return;
+                       case GameState.CutStart:
+                               if (puzzle != null)
+                                       puzzle.Dispose ();
+                               puzzle = new Puzzle (NbPceX, NbPceY, ImagePath);
+                               mainShader.Enable ();
+                               mainShader.ImgSize = new Vector2 (puzzle.Image.Width, puzzle.Image.Height);
+                               puzzle.Shuffle ();
+                               eyeDistTarget = puzzle.Image.Width * 1.5f;
+                               EyeDist = eyeDistTarget;
+                               currentState = GameState.Play;
+                               RebuildCache = true;
+                               return;
+                       case GameState.CutFinished:
+                               return;
+                       }
+
+                       GGL.Animation.ProcessAnimations ();
+
+                       if (RebuildCache)
+                               updateCache ();
+
+               }
+               #endregion
+
+               #region vLookCalculations
+               public void UpdateViewMatrix()
+               {
+                       Rectangle r = this.ClientRectangle;
+                       GL.Viewport( r.X, r.Y, r.Width, r.Height);
+                       projection = Matrix4.CreatePerspectiveFieldOfView (fovY, r.Width / (float)r.Height, zNear, zFar);
+                       vLook = Vector3.Transform (vLookInit,
+                               Matrix4.CreateRotationX (viewXangle)*
+                               Matrix4.CreateRotationZ (viewZangle));
+                       vLook.Normalize();
+                       vEye = vEyeTarget + vLook * eyeDist;
+                       modelview = Matrix4.LookAt(vEye, vEyeTarget, Vector3.UnitZ);
+                       GL.GetInteger(GetPName.Viewport, viewport);
+
+                       mainShader.Enable ();
+                       mainShader.SetMVP(modelview * projection);
+                       RebuildCache = true;
+               }
+               #endregion
+
+               #region Keyboard
+               protected override void OnKeyDown (OpenTK.Input.KeyboardKeyEventArgs e)
+               {
+                       base.OnKeyDown (e);
+                       switch (e.Key) {
+                       case OpenTK.Input.Key.Space:
+                               if (puzzle != null)
+                                       puzzle.resolve ();
+                               break;
+                       case OpenTK.Input.Key.Escape:
+                               if (puzzleIsReady)
+                                       closeCurrentPuzzle ();
+                               else
+                                       closeGame ();
+                               break;
+                       }
+               }
+               #endregion
+
+               #region Mouse
+               void Mouse_ButtonDown (object sender, OpenTK.Input.MouseButtonEventArgs e)
+               {
+                       if (!puzzleIsReady)
+                               return;
+
+                       if (e.Button == OpenTK.Input.MouseButton.Left) {
+                               Piece[] tmp = null;
+
+                               lock (puzzle.Mutex)
+                                       tmp = puzzle.ZOrderedPieces.ToArray();
+                               
+                               for (int i = tmp.Length-1; i >= 0; i--) {                                       
+                                       Piece p = tmp [i];
+                                       if (p.MouseIsIn (vMousePos)) {
+                                               //this.CursorVisible = false;
+                                               puzzle.SelectedPiece = p;
+                                               p.ResetVisitedStatus ();
+                                               p.PutOnTop ();
+                                               p.ResetVisitedStatus ();
+                                               p.Move (0f, 0f, zSelPce);
+                                               break;
+                                       }
+                               }
+                       } else if (e.Button == OpenTK.Input.MouseButton.Right) {
+                               if (puzzle.SelectedPiece == null)
+                                       return;
+                               puzzle.SelectedPiece.ResetVisitedStatus ();
+                               puzzle.SelectedPiece.Rotate (puzzle.SelectedPiece);
+                       }
+
+               }
+               void Mouse_ButtonUp (object sender, OpenTK.Input.MouseButtonEventArgs e)
+               {                               
+                       if (!puzzleIsReady)
+                               return; 
+                       if (puzzle.SelectedPiece == null || e.Button != OpenTK.Input.MouseButton.Left)
+                               return;
+                       
+                       puzzle.SelectedPiece.ResetVisitedStatus ();
+                       puzzle.SelectedPiece.Move (0f, 0f, -zSelPce);
+                       puzzle.SelectedPiece.ResetVisitedStatus ();
+                       puzzle.SelectedPiece.Test ();
+                       puzzle.SelectedPiece.ResetVisitedStatus ();
+                       if (puzzle.SelectedPiece.PuzzleIsFinished) {
+                               showFinishedMsg ();
+                       }
+                       //ensure newly linked pce are on top of others
+                       puzzle.SelectedPiece.ResetVisitedStatus ();
+                       puzzle.SelectedPiece.PutOnTop ();
+                       puzzle.SelectedPiece = null;
+               }
+               Vector3 vMousePos;
+               void Mouse_Move(object sender, OpenTK.Input.MouseMoveEventArgs e)
+               {                       
+                       if (!puzzleIsReady)
+                               return;
+                       if (e.XDelta != 0 || e.YDelta != 0)
+                       {                               
+                               Vector3 vMouse = glHelper.UnProject(ref projection, ref modelview, viewport, new Vector2 (e.X, e.Y)).Xyz;
+                               Vector3 vMouseRay = Vector3.Normalize(vMouse - vEye);
+                               float a = -vMouse.Z / vMouseRay.Z;
+                               Vector3 vNewMousePos = vMouse + vMouseRay * a;
+                               Vector3 vMouseDelta = vNewMousePos - vMousePos;
+                               vMousePos = vNewMousePos;
+
+                               if (e.Mouse.MiddleButton == OpenTK.Input.ButtonState.Pressed) {
+                                       //viewZangle -= (float)e.XDelta * RotationSpeed;
+                                       viewXangle -= (float)e.YDelta * RotationSpeed;
+                                       if (viewXangle < - 0.75f)
+                                               viewXangle = -0.75f;
+                                       else if (viewXangle > MathHelper.PiOver4)
+                                               viewXangle = MathHelper.PiOver4;
+                                       UpdateViewMatrix ();
+                                       return;
+                               }
+                               if (e.Mouse.LeftButton == OpenTK.Input.ButtonState.Pressed) {
+                                       if (puzzle.SelectedPiece != null) {                                             
+                                               Piece p = puzzle.SelectedPiece;
+                                               p.ResetVisitedStatus ();
+                                               p.Move (vMouseDelta.X, vMouseDelta.Y);
+                                               return;
+                                       }
+                               }
+                               if (e.Mouse.RightButton == OpenTK.Input.ButtonState.Pressed) {
+                                       Matrix4 m = Matrix4.CreateTranslation (-e.XDelta, e.YDelta, 0);
+                                       vEyeTarget = Vector3.Transform (vEyeTarget, m);
+                                       UpdateViewMatrix();
+                                       return;
+                               }
+                       }
+
+               }                       
+               void Mouse_WheelChanged(object sender, OpenTK.Input.MouseWheelEventArgs e)
+               {
+                       if (!puzzleIsReady)
+                               return;
+                       float speed = MoveSpeed;
+                       if (Keyboard[OpenTK.Input.Key.ShiftLeft])
+                               speed *= 0.1f;
+                       else if (Keyboard[OpenTK.Input.Key.ControlLeft])
+                               speed *= 20.0f;
+
+                       eyeDistTarget -= e.Delta * speed;
+                       if (eyeDistTarget < zNear+10)
+                               eyeDistTarget = zNear+10;
+                       else if (eyeDistTarget > zFar-100)
+                               eyeDistTarget = zFar-100;
+                       Animation.StartAnimation(new Animation<float> (this, "EyeDist", eyeDistTarget, (eyeDistTarget - eyeDist) * 0.2f));
+               }
+               #endregion
+
+               #region CTOR and Main
+               public MainWin (int numSamples = 4)
+                       : base(1024, 800, 32, 24, 0, numSamples, "Opuz")
+               {                       
+               }
+
+               [STAThread]
+               static void Main ()
+               {
+                       Console.WriteLine ("starting example");
+
+                       using (MainWin win = new MainWin( )) {
+                               win.Run (30.0);
+                       }
+               }
+               #endregion
+       }
+}
\ No newline at end of file
diff --git a/Tests/packages.config b/Tests/packages.config
new file mode 100644 (file)
index 0000000..25c974b
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="OpenTK" version="1.1.2349.61993" targetFramework="net45" />
+</packages>
\ No newline at end of file
diff --git a/Tests/ui/LabelButton.style b/Tests/ui/LabelButton.style
new file mode 100644 (file)
index 0000000..d376121
--- /dev/null
@@ -0,0 +1,8 @@
+MouseEnter = {Background = Gray;Foreground = White}
+Fit = true
+MouseLeave = {Background=Transparent;Foreground=Gray}
+MouseDown = {Background=Red;Foreground=White}
+MouseUp = {Background=Gray;Foreground=White}
+Foreground=Gray
+Margin=5
+CornerRadius=5
diff --git a/Tests/ui/MenuItem.style b/Tests/ui/MenuItem.style
new file mode 100644 (file)
index 0000000..8011ebc
--- /dev/null
@@ -0,0 +1,11 @@
+Height = Fit
+Width = Stretched
+MinimumSize=60;10
+Margin=2
+CornerRadius=0
+TextAlignment=Left
+Foreground=Gray
+MouseEnter = {Background=SeaGreen;Foreground=White}
+MouseLeave = {Background=Transparent;Foreground=Gray}
+MouseDown = {Background=White;Foreground=DimGray}
+MouseUp = {Background=SeaGreen;Foreground=White}
diff --git a/Tests/ui/Popper.template b/Tests/ui/Popper.template
new file mode 100755 (executable)
index 0000000..ffcd8d4
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<Label Text="{../Caption}" Style="#Tests.ui.LabelButton.style"
+       Height="Fit" Width="{../WidthPolicy}"/>
diff --git a/Tests/ui/fps.crow b/Tests/ui/fps.crow
deleted file mode 100755 (executable)
index 603387f..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0"?>
-<Window Font="droid bold, 10" Title="Open GL" Width="120" Height="200"
-       MinimumSize="160;250"
-       Template="#GLC.ui.tmpWindow.crow"
-       HorizontalAlignment="Right" Top="10">
-       <VerticalStack Height="Fit" Width="95%" Spacing="10">
-               <HorizontalStack Height="Fit" Width="Stretched">
-                       <Label Text="Frame:" Width="25%" TextAlignment="Right" Background="Mantis"/>
-                       <Label Text="{frameTime}" Font="droid , 12" Width="75%"
-                               TextAlignment="Center" Background="Teal"/>
-               </HorizontalStack>
-               <HorizontalStack Height="Fit" Width="Stretched">
-                       <Label Text="Max:" Width="25%" TextAlignment="Right" Background="Mantis"/>
-                       <Label Text="{frameMax}" Font="droid , 12" Width="75%"
-                               TextAlignment="Center" Background="Teal"/>
-               </HorizontalStack>
-               <HorizontalStack Height="Fit" Width="Stretched">
-                       <Label Text="Min:" Width="25%" TextAlignment="Right" Background="Mantis"/>
-                       <Label Text="{frameMin}" Font="droid , 12" Width="75%"
-                               TextAlignment="Center" Background="Teal"/>
-               </HorizontalStack>
-               <HorizontalStack Height="Fit" Width="Stretched">
-                       <Label Text="Fps:" Width="30%" TextAlignment="Right" Background="Onyx"/>
-                       <Label Text="{fps}" Font="droid , 12" Width="70%"
-                               TextAlignment="Center" Background="Teal"/>
-               </HorizontalStack>
-               <HorizontalStack Height="Fit" Width="Stretched">
-                       <Label Text="Min:" Width="30%" TextAlignment="Right" Background="Mantis"/>
-                       <Label Text="{fpsMin}" Font="droid , 12" Width="70%"
-                               TextAlignment="Center" Background="Teal"/>
-               </HorizontalStack>
-               <HorizontalStack Height="Fit" Width="Stretched">
-                       <Label Text="Max:" Width="30%" TextAlignment="Right" Background="Mantis"/>
-                       <Label Text="{fpsMax}" Font="droid , 12" Width="70%"
-                               TextAlignment="Center" Background="Teal"/>
-               </HorizontalStack>
-               <Button Caption="Reset Min/Max times" MouseClick="onResetTimes"/>
-<!--           <HorizontalStack Fit="true">
-                       <Label Text="GPU Mem:" TextAlignment="Right"/>
-                       <Label Text="{gpuTotalMem}" Font="droid , 12" Width="50"
-                               TextAlignment="Center" Background="Teal"/>
-               </HorizontalStack>
-               <HorizontalStack Fit="true">
-                       <Label Text="GPU Mem:" TextAlignment="Right"/>
-                       <Label Text="{gpuDedicatedMem}" Font="droid , 12" Width="50"
-                               TextAlignment="Center" Background="Teal"/>
-               </HorizontalStack>
-               <HorizontalStack Fit="true">
-                       <Label Text="GPU Mem:"  TextAlignment="Right"/>
-                       <Label Text="{gpuFreeMem}" Font="droid , 12" Width="50"
-                               TextAlignment="Center" Background="Teal"/>
-               </HorizontalStack>-->
-               <Button Caption="Update GPU mem info" MouseClick="onUpdateGPUMemInfo"/>
-       </VerticalStack>                                
-</Window>
\ No newline at end of file
diff --git a/Tests/ui/test.crow b/Tests/ui/test.crow
new file mode 100755 (executable)
index 0000000..829beb9
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<Window Font="droid bold, 10" Title="Open GL" Width="60%" Height="50%">
+       <VerticalStack>
+               <HorizontalStack Background="Jet" Height="Fit" Width="Stretched"  Margin="2">
+                       <Popper Caption="File" Template="#Tests.ui.Popper.template" Width="Fit">
+                               <Border Fit="True" Foreground="Gray" Background="Jet">
+                                       <VerticalStack Height="Fit" Width="Fit" Margin="2">
+                                               <Label Text="New File" Style="#Tests.ui.MenuItem.style" />
+                                               <Label Text="Open..." Style="#Tests.ui.MenuItem.style"/>
+                                               <Label Text="Save..." Style="#Tests.ui.MenuItem.style"/>
+                                               <Label Text="Exit" Style="#Tests.ui.MenuItem.style"/>
+                                       </VerticalStack>
+                               </Border>
+                       </Popper>
+                       <Label Text="Edit" Style="#Tests.ui.LabelButton.style"/>
+                       <Label Text="Project" Style="#Tests.ui.LabelButton.style"/>
+                       <Label Text="Help" Style="#Tests.ui.LabelButton.style"/>
+               </HorizontalStack>      
+       </VerticalStack>
+</Window>
\ No newline at end of file
index 9bd3176390f78cb8b9298a866f027c1cb76f4bd4..59b4be18125048cbf79d3fff45860673573837ed 100644 (file)
@@ -261,13 +261,23 @@ namespace Crow
                                this.RegisterForLayouting (LayoutingType.Height);
                        }
                }
+               /// <summary>
+               /// Used for binding on dimensions, this property will never hold fixed size, but instead only
+               /// Fit or Stretched
+               /// </summary>
                [XmlIgnore]public virtual Measure WidthPolicy { get {
                                return Width.Units == Unit.Percent || Width.IsFixed ?
                                        Measure.Stretched : Measure.Fit; } }
+               /// <summary>
+               /// Used for binding on dimensions, this property will never hold fixed size, but instead only
+               /// Fit or Stretched
+               /// </summary>
                [XmlIgnore]public virtual Measure HeightPolicy { get {
                                return Height.Units == Unit.Percent || Height.IsFixed ?
                                        Measure.Stretched : Measure.Fit; } }
-
+               /// <summary>
+               /// When set to True, the <see cref="T:Crow.GraphicObject"/>'s width and height will be set to Fit.
+               /// </summary>
                [XmlAttributeAttribute()][DefaultValue(false)]
                public virtual bool Fit {
                        get { return Width == Measure.Fit && Height == Measure.Fit ? true : false; }
@@ -729,8 +739,9 @@ namespace Crow
                        LayoutChanged.Raise (this, new LayoutingEventArgs (layoutType));
                }
 
-               /// <summary> Update layout component, this is where the computation of alignement
-               /// and size take place </summary>
+               /// <summary> Update layout component only one at a time, this is where the computation of alignement
+               /// and size take place.
+               /// The redrawing will only be triggered if final slot size has changed </summary>
                /// <returns><c>true</c>, if layouting was possible, <c>false</c> if conditions were not
                /// met and LQI has to be re-queued</returns>
                public virtual bool UpdateLayout (LayoutingType layoutType)
@@ -759,6 +770,15 @@ namespace Crow
                                        }
                                } else
                                        Slot.X = Left;
+
+                               if (LastSlots.X == Slot.X)
+                                       break;
+
+                               bmp = null;
+
+                               OnLayoutChanges (layoutType);
+
+                               LastSlots.X = Slot.X;
                                break;
                        case LayoutingType.Y:
                                if (Top == 0) {
@@ -780,6 +800,15 @@ namespace Crow
                                        }
                                } else
                                        Slot.Y = Top;
+                               
+                               if (LastSlots.Y == Slot.Y)
+                                       break;
+
+                               bmp = null;
+
+                               OnLayoutChanges (layoutType);
+
+                               LastSlots.Y = Slot.Y;
                                break;
                        case LayoutingType.Width:
                                if (Visible) {
@@ -807,6 +836,15 @@ namespace Crow
                                        }
                                } else
                                        Slot.Width = 0;
+
+                               if (LastSlots.Width == Slot.Width)
+                                       break;
+
+                               bmp = null;
+
+                               OnLayoutChanges (layoutType);
+
+                               LastSlots.Width = Slot.Width;
                                break;
                        case LayoutingType.Height:
                                if (Visible) {
@@ -834,51 +872,7 @@ namespace Crow
                                        }
                                } else
                                        Slot.Height = 0;
-                               break;
-                       }
-
-                       updateSlot (layoutType);
-
-                       //if no layouting remains in queue for item, registre for redraw
-                       if (this.registeredLayoutings == LayoutingType.None && bmp == null)
-                               this.AddToRedrawList ();
-
-                       return true;
-               }
-               protected void updateSlot(LayoutingType layoutType)
-               {
-                       switch (layoutType) {
-                       case LayoutingType.X:
-                               if (LastSlots.X == Slot.X)
-                                       break;
-
-                               bmp = null;
-
-                               OnLayoutChanges (layoutType);
-
-                               LastSlots.X = Slot.X;                           
-                               break;
-                       case LayoutingType.Y:
-                               if (LastSlots.Y == Slot.Y)
-                                       break;
-
-                               bmp = null;
-
-                               OnLayoutChanges (layoutType);
-
-                               LastSlots.Y = Slot.Y;                           
-                               break;
-                       case LayoutingType.Width:
-                               if (LastSlots.Width == Slot.Width)
-                                       break;
-
-                               bmp = null;
-
-                               OnLayoutChanges (layoutType);
-
-                               LastSlots.Width = Slot.Width;                           
-                               break;
-                       case LayoutingType.Height:
+                               
                                if (LastSlots.Height == Slot.Height)
                                        break;
 
@@ -886,9 +880,15 @@ namespace Crow
 
                                OnLayoutChanges (layoutType);
 
-                               LastSlots.Height = Slot.Height;                         
+                               LastSlots.Height = Slot.Height; 
                                break;
                        }
+
+                       //if no layouting remains in queue for item, registre for redraw
+                       if (this.registeredLayoutings == LayoutingType.None && bmp == null)
+                               this.AddToRedrawList ();
+
+                       return true;
                }
                #endregion
 
index 30fded86b2656f962dd7010a6c6bd1d09ddbcef6..ae48f9976e67d2bd136a9cf466e2f85b4e355415 100644 (file)
@@ -10,8 +10,7 @@ namespace Crow
     {
         public HorizontalStack()
             : base()
-        {
-            Orientation = Crow.Orientation.Horizontal;
+        {            
         }
 
         [XmlIgnore]
index 4fd845548a0f06c1e3b88529bb2581c47b028c55..5e5541fefde0ed81677d830633b3d4fd09593a6c 100644 (file)
@@ -89,6 +89,17 @@ namespace Crow
                        }
                }
 
+               public override void OnLayoutChanges (LayoutingType layoutType)
+               {
+                       base.OnLayoutChanges (layoutType);
+
+                       if (_content == null)
+                               return;
+                       
+                       if (layoutType == LayoutingType.Width)
+                               _content.MinimumSize = new Size (this.Slot.Width, _content.MinimumSize.Height);                 
+               }
+
                #region GraphicObject overrides
                public override void ClearBinding ()
                {
index 26720b1de254d98a2ea208ea7ed64d774428e0ef..3b2cebf43423f14e6f94a75235cc6638320fc642 100644 (file)
@@ -9,6 +9,7 @@ using System.Diagnostics;
 
 namespace Crow
 {
+       [DefaultStyle ("#Crow.Styles.Slider.style")]
        public class Slider : NumericControl
     {
                #region CTOR
@@ -77,6 +78,7 @@ namespace Crow
                        }
                }
                #endregion
+
                [XmlAttributeAttribute()][DefaultValue(10.0)]
                public override double Maximum {
                        get { return base.Maximum; }
@@ -90,23 +92,6 @@ namespace Crow
                }
 
                #region GraphicObject Overrides
-               [XmlAttributeAttribute()][DefaultValue("vgradient|0:Black|0,1:Gray|0,9:Gray|1:LightGray")]
-               public override Fill Background {
-                       get { return base.Background; }
-                       set { base.Background = value; }
-               }
-               [XmlAttributeAttribute()][DefaultValue("Gray")]
-               public override Fill Foreground {
-                       get { return base.Foreground; }
-                       set { base.Foreground = value; }
-               }
-               [XmlAttributeAttribute()][DefaultValue(true)]
-               public override bool Focusable
-               {
-                       get { return base.Focusable; }
-                       set { base.Focusable = value; }
-               }
-
                protected override void onDraw (Context gr)
                {
                        base.onDraw (gr);
index 9fd8180dd61a394d23c717fb3a77fd851cf3628d..38d56c5d640ee7253598e6a245735e5a1e4b298f 100644 (file)
@@ -25,6 +25,7 @@ using System.Diagnostics;
 
 namespace Crow
 {
+       [DefaultStyle ("#Crow.Styles.TabItem.style")]
        [DefaultTemplate("#Crow.Templates.TabItem.crow")]
        public class TabItem : TemplatedContainer
        {
@@ -66,21 +67,6 @@ namespace Crow
                internal GraphicObject TabTitle { get { return _tabTitle; }}
                #endregion
 
-               #region GraphicObject overrides
-               [XmlAttributeAttribute()][DefaultValue(true)]
-               public override bool Focusable
-               {
-                       get { return base.Focusable; }
-                       set { base.Focusable = value; }
-               }
-               //prevent caching, because drawing order is different depending on selected tab
-               [XmlAttributeAttribute()][DefaultValue(false)]
-               public override bool CacheEnabled {
-                       get {return false;}
-                       set { }
-               }
-               #endregion
-
                [XmlAttributeAttribute()][DefaultValue(0)]
                public virtual int TabOffset {
                        get { return tabOffset; }
index afd2642941c781c177fc405f064f74e8db2ed7b0..e3d5e588ece7eeae3e47cae06fa5d5177d95ac2e 100644 (file)
@@ -10,14 +10,12 @@ namespace Crow
         public VerticalStack()
             : base()
         {
-            Orientation = Crow.Orientation.Vertical;
         }
 
         [System.Xml.Serialization.XmlIgnore]
         public override Orientation Orientation
         {
-            get { return Orientation.Vertical; }
-            //set {  }
+            get { return Orientation.Vertical; }            
         }
 
 
index d0c385e781a2f5242c241d6544c4e0ea58ceefae..b8426e6f8a1231d4dad7f78b0851e2474cec5ad4 100644 (file)
@@ -30,6 +30,15 @@ using Cairo;
 
 namespace Crow
 {
+       /// <summary>
+       /// The Interface Class is the top container of the application.
+       /// It provides the Dirty bitmap and zone of the interface to be drawn on screen
+       /// 
+       /// The Interface contains :
+       ///     - rendering and layouting queues and logic.
+       ///     - helpers to load XML interfaces files
+       ///     - global constants and variables of CROW
+       /// </summary>
        public class Interface : ILayoutable
        {
                #region CTOR
@@ -58,6 +67,7 @@ namespace Crow
 
                public static int TabSize = 4;
                public static string LineBreak = "\r\n";
+               //TODO: shold be declared in graphicObject
                public static bool FocusOnHover = false;
                /// <summary> Time to wait in millisecond before starting repeat loop</summary>
                public static int DeviceRepeatDelay = 600;
@@ -68,11 +78,18 @@ namespace Crow
                public static bool DesignerMode = false;
                /// <summary> Threshold to catch borders for sizing </summary>
                public static int BorderThreshold = 5;
+               /// <summary> Disable caching for a widget if this threshold is reached </summary>
                public const int MaxCacheSize = 2048;
+               /// <summary> Above this count, the layouting is discard for the widget and it
+               /// will not be rendered on screen </summary>
                public const int MaxLayoutingTries = 50;
+               /// <summary> Global font rendering settings for Cairo </summary>
                public static FontOptions FontRenderingOptions;
                #endregion
 
+               /// <summary>
+               /// The layouting queue contains layouting commands
+               /// </summary>
                public Queue<LayoutingQueueItem> LayoutingQueue;
                public Queue<GraphicObject> GraphicUpdateQueue = new Queue<GraphicObject>();
                public string Clipboard;
@@ -98,6 +115,10 @@ namespace Crow
                }
 
                #region default values loading helpers
+               /// Default values of properties from GraphicObjects are retrieve from XML Attributes.
+               /// The reflexion process used to retrieve those values being very slow, it is compiled in MSIL
+               /// and injected as a dynamic method referenced in the DefaultValuesLoader Dictionnary.
+               /// The compilation is done on the first object instancing, and is also done for custom widgets
                public delegate void loadDefaultInvoker(object instance);
                public static Dictionary<String, loadDefaultInvoker> DefaultValuesLoader = new Dictionary<string, loadDefaultInvoker>();
                #endregion
index 933fc57cf1b7160f09ed9d5e01d2dbb999ae5f4e..826734449783cbfe5473ac59bea4a69f1de0b256 100644 (file)
@@ -36,19 +36,26 @@ namespace Crow
                ArrangeChildren = 0x10,
                All = 0xFF
        }
-
+       /// <summary>
+       /// Element class of the LayoutingQueue
+       /// </summary>
        public class LayoutingQueueItem
-       {               
+       {
+               /// <summary> Instance of widget to be layouted</summary>
                public ILayoutable GraphicObject;
+               /// <summary> Bitfield containing the element of the layout to performs (x|y|width|height)</summary>
                public LayoutingType LayoutType;
 
+               #region CTOR
                public LayoutingQueueItem (LayoutingType _layoutType, ILayoutable _graphicObject)
                {
                        LayoutType = _layoutType;
                        GraphicObject = _graphicObject;
                        GraphicObject.RegisteredLayoutings |= LayoutType;
                }
-       
+               #endregion
+
+
                public void ProcessLayouting()
                {
                        if (GraphicObject.Parent == null) {
index 64e5cc98e8e6f2c35ca39f5388db3a2144f88c4f..19e8f548651760c72c347711e34e5f6d8b52e24b 100644 (file)
@@ -22,22 +22,47 @@ using System;
 
 namespace Crow
 {
+       /// <summary>
+       /// Measurement unit
+       /// </summary>
        public enum Unit { Pixel, Percent }
+       /// <summary>
+       /// Measure class allow proportional sizes as well as stretched and fit on content.
+       /// </summary>
        public struct Measure
        {
+               /// <summary>
+               /// Integer value of the measure
+               /// </summary>
                public int Value;
+               /// <summary>
+               /// Measurement unit
+               /// </summary>
                public Unit Units;
 
+               /// <summary>
+               /// Fit on content, this special measure is defined as a fixed integer set to -1 pixel
+               /// </summary>
                public static Measure Fit = new Measure(-1);
-               //TODO:implement stretching as 100%, not 0%
+               /// <summary>
+               /// Stretched into parent client area. This special measure is defined as a proportional cote
+               /// set to 100 Percents
+               /// </summary>
                public static Measure Stretched = new Measure(100, Unit.Percent);
 
+               #region CTOR
                public Measure (int _value, Unit _units = Unit.Pixel)
                {
                        Value = _value;
                        Units = _units;
                }
+               #endregion
+
+               /// <summary>
+               /// True is size is fixed in pixels, this means not proportional, stretched nor fit.
+               /// </summary>
                public bool IsFixed { get { return Value > 0 && Units == Unit.Pixel; }}
+
                #region Operators
                public static implicit operator int(Measure m){
                        return m.Value;
@@ -59,6 +84,8 @@ namespace Crow
                        return !(m1.Value == m2.Value && m1.Units == m2.Units);
                }
                #endregion
+
+               #region Object overrides
                public override int GetHashCode ()
                {
                        return Value.GetHashCode ();
@@ -75,6 +102,8 @@ namespace Crow
                                Units == Unit.Percent ? Value == 100 ? "Stretched" :
                                Value.ToString () + "%" : Value.ToString ();
                }
+               #endregion
+
                public static Measure Parse(string s){
                        if (string.IsNullOrEmpty (s))
                                return Measure.Stretched;