Skip to content

Commit

Permalink
Refactor project structure
Browse files Browse the repository at this point in the history
Move types not directly related to wrapping OpenGL features to a separate namespace and assembly: ObjectTK.Tools
Rename ObjectTKC project to ObjectTK.Compiler
Change target framework version down to 4.0
Update license text and assembly infos
Add shared resharper settings
  • Loading branch information
JcBernack committed Jan 4, 2015
1 parent 581b26f commit e53b67c
Show file tree
Hide file tree
Showing 112 changed files with 617 additions and 330 deletions.
2 changes: 1 addition & 1 deletion Examples/AdvancedExamples/FeedbackGravityExample.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using Examples.Shaders;
using ObjectTK.Buffers;
using ObjectTK.Shaders;
using Examples.Shaders;
using OpenTK;
using OpenTK.Graphics.OpenGL;
using OpenTK.Input;
Expand Down
2 changes: 1 addition & 1 deletion Examples/AdvancedExamples/ParallaxMappingExample.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using Examples.Shaders;
using ObjectTK.Buffers;
using ObjectTK.Shaders;
using ObjectTK.Textures;
using Examples.Shaders;
using OpenTK;
using OpenTK.Graphics.OpenGL;
using OpenTK.Input;
Expand Down
4 changes: 2 additions & 2 deletions Examples/AdvancedExamples/RenderToTextureExample.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.Drawing;
using Examples.Shaders;
using ObjectTK.Buffers;
using ObjectTK.Shaders;
using ObjectTK.Shapes;
using ObjectTK.Textures;
using Examples.Shaders;
using ObjectTK.Tools.Shapes;
using OpenTK;
using OpenTK.Graphics.OpenGL;

Expand Down
2 changes: 1 addition & 1 deletion Examples/BasicExamples/BufferLayoutTexturingExample.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using Examples.Shaders;
using ObjectTK.Buffers;
using ObjectTK.Shaders;
using ObjectTK.Textures;
using Examples.Shaders;
using OpenTK;
using OpenTK.Graphics.OpenGL;
using OpenTK.Input;
Expand Down
2 changes: 1 addition & 1 deletion Examples/BasicExamples/MinimalExample.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.Drawing;
using Examples.Shaders;
using ObjectTK.Buffers;
using ObjectTK.Shaders;
using Examples.Shaders;
using OpenTK;
using OpenTK.Graphics.OpenGL;

Expand Down
4 changes: 2 additions & 2 deletions Examples/BasicExamples/SkyboxExample.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.Drawing;
using Examples.Shaders;
using ObjectTK.Buffers;
using ObjectTK.Shaders;
using ObjectTK.Shapes;
using ObjectTK.Textures;
using Examples.Shaders;
using ObjectTK.Tools.Shapes;
using OpenTK;
using OpenTK.Graphics.OpenGL;

Expand Down
2 changes: 1 addition & 1 deletion Examples/BasicExamples/TextureGridExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using System.Drawing;
using System.IO;
using System.Runtime.InteropServices;
using Examples.Shaders;
using ObjectTK.Buffers;
using ObjectTK.Shaders;
using ObjectTK.Textures;
using Examples.Shaders;
using OpenTK;
using OpenTK.Graphics.OpenGL;

Expand Down
3 changes: 2 additions & 1 deletion Examples/ExampleBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Reflection;
using System.Windows.Forms;
using ObjectTK;
using OpenTK;

namespace Examples
Expand Down Expand Up @@ -32,7 +33,7 @@ private void ExampleBrowser_Load(object sender, EventArgs e)
? existingNodes[0]
: treeViewExamples.Nodes.Add(type.Namespace, type.Namespace);
// add node for this example and get the caption from the attribute
var captionAttribute = type.GetCustomAttributes<ExampleProjectAttribute>().FirstOrDefault();
var captionAttribute = type.GetCustomAttributes<ExampleProjectAttribute>(false).FirstOrDefault();
node.Nodes.Add(type.Name, captionAttribute == null ? type.Name : captionAttribute.Caption);
// remember example type
_examples.Add(type.Name, type);
Expand Down
4 changes: 2 additions & 2 deletions Examples/ExampleWindow.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using ObjectTK;
using ObjectTK.Cameras;
using ObjectTK.Shaders;
using ObjectTK.Utilities;
using ObjectTK.Tools;
using ObjectTK.Tools.Cameras;
using OpenTK;
using OpenTK.Graphics;
using OpenTK.Input;
Expand Down
21 changes: 11 additions & 10 deletions Examples/Examples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Examples</RootNamespace>
<AssemblyName>Examples</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand All @@ -32,10 +32,12 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net">
<Reference Include="log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
</Reference>
<Reference Include="OpenTK">
<Reference Include="OpenTK, Version=1.1.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\OpenTK.1.1.1589.5942\lib\NET40\OpenTK.dll</HintPath>
</Reference>
<Reference Include="System" />
Expand Down Expand Up @@ -83,9 +85,13 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ObjectTKC\ObjectTKC.csproj">
<ProjectReference Include="..\ObjectTK.Compiler\ObjectTK.Compiler.csproj">
<Project>{abd0be84-792d-4f52-82e2-c869585b3c29}</Project>
<Name>ObjectTKC</Name>
<Name>ObjectTK.Compiler</Name>
</ProjectReference>
<ProjectReference Include="..\ObjectTK.Tools\ObjectTK.Tools.csproj">
<Project>{E38997F8-7ECE-4B35-BB94-7E609F68D217}</Project>
<Name>ObjectTK.Tools</Name>
</ProjectReference>
<ProjectReference Include="..\ObjectTK\ObjectTK.csproj">
<Project>{0ee3347b-1bbe-44ca-8295-22da13ae914a}</Project>
Expand All @@ -106,11 +112,6 @@
<Content Include="Data\Textures\swizzled-rock-diffuse-height.dds" />
<Content Include="Data\Textures\swizzled-rock-normal-gloss.dds" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ExampleBrowser.resx">
<DependentUpon>ExampleBrowser.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>rd /Q /S "$(TargetDir)Data"
Expand Down
4 changes: 2 additions & 2 deletions Examples/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ObjectTK examples")]
[assembly: AssemblyDescription("Contains examples for ObjectTK")]
[assembly: AssemblyDescription("Examples to demonstrate usage of ObjectTK")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("JcBernack")]
[assembly: AssemblyProduct("ObjectTK")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyCopyright("Copyright © 2014-2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
17 changes: 10 additions & 7 deletions Examples/app.config
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<log4net>
<appender name="LogFileAppender" type="log4net.Appender.FileAppender">
<param name="File" value="Log.txt" />
<param name="AppendToFile" value="false" />
<param name="File" value="Log.txt"/>
<param name="AppendToFile" value="false"/>
<layout type="log4net.Layout.PatternLayout">
<param name="Header" value="[Application startup]&#xD;&#xA;" />
<param name="Footer" value="[Application shutdown]&#xD;&#xA;" />
<param name="ConversionPattern" value="%date [%thread] %-5level %class %message%newline" />
</layout>
</appender>
<root>
<level value="INFO" />
<appender-ref ref="LogFileAppender" />
<level value="INFO"/>
<appender-ref ref="LogFileAppender"/>
</root>
</log4net>
</configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
4 changes: 2 additions & 2 deletions Examples/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="log4net" version="2.0.3" targetFramework="net45" />
<package id="OpenTK" version="1.1.1589.5942" targetFramework="net45" />
<package id="log4net" version="2.0.3" targetFramework="net40" />
<package id="OpenTK" version="1.1.1589.5942" targetFramework="net40" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
<ProjectGuid>{ABD0BE84-792D-4F52-82E2-C869585B3C29}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ObjectTKC</RootNamespace>
<RootNamespace>ObjectTK.Compiler</RootNamespace>
<AssemblyName>ObjectTKC</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
Expand Down Expand Up @@ -44,6 +44,7 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
using System.Reflection;
#region License
// ObjectTK License
// Copyright (C) 2013-2015 J.C.Bernack
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ObjectTKC")]
[assembly: AssemblyTitle("ObjectTK ShaderCompiler")]
[assembly: AssemblyDescription("Shader compiler for integrated GLSL shader validation in MSBuild and Visual Studio")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("JcBernack")]
[assembly: AssemblyProduct("ObjectTKC")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyProduct("ObjectTK.Compiler")]
[assembly: AssemblyCopyright("Copyright © 2014-2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#region License
// ObjectTK License
// Copyright (C) 2013-2014 J.C.Bernack
// Copyright (C) 2013-2015 J.C.Bernack
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand All @@ -13,7 +13,7 @@
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.IO;
Expand All @@ -24,7 +24,7 @@
using ObjectTK.Shaders;
using OpenTK;

namespace ObjectTKC
namespace ObjectTK.Compiler
{
/// <summary>
/// Compiles all shader programs contained in assemblies given per command line arguments and outputs errors in a MSBuild and Visual Studio friendly way.<br/>
Expand Down Expand Up @@ -80,7 +80,7 @@ public static void Main(string[] args)
// set working directory
Directory.SetCurrentDirectory(Path.GetDirectoryName(assembly.Location));
// iterate over all defined shader programs
foreach (var type in assembly.DefinedTypes.Where(_ => typeof (Program).IsAssignableFrom(_)))
foreach (var type in assembly.GetTypes().Where(_ => typeof (Program).IsAssignableFrom(_)))
{
// check if the program has any shader sources tagged to it
if (ShaderSourceAttribute.GetShaderSources(type).Count == 0) continue;
Expand Down
6 changes: 6 additions & 0 deletions ObjectTK.Compiler/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="OpenTK" version="1.1.1589.5942" targetFramework="net45" />
<package id="OpenTK" version="1.1.1589.5942" targetFramework="net40" />
</packages>
19 changes: 18 additions & 1 deletion ObjectTK/Cameras/Camera.cs → ObjectTK.Tools/Cameras/Camera.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
#region License
// ObjectTK License
// Copyright (C) 2013-2015 J.C.Bernack
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using OpenTK;
using OpenTK.Input;

namespace ObjectTK.Cameras
namespace ObjectTK.Tools.Cameras
{
public class Camera
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
#region License
// ObjectTK License
// Copyright (C) 2013-2015 J.C.Bernack
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#endregion
using OpenTK;

namespace ObjectTK.Cameras
namespace ObjectTK.Tools.Cameras
{
public abstract class CameraBehavior
{
Expand Down
Loading

0 comments on commit e53b67c

Please sign in to comment.