In the Roslyn preview that was released at Build 2014 the way references to global assmeblies are added was changed. Before the preview I could use code like this:
var compilation = Compilation.Create(assemblyName, new CompilationOptions(OutputKind.DynamicallyLinkedLibrary)) .AddReferences(MetadataReference.CreateAssemblyReference(“mscorlib”)) .AddReferences(MetadataReference.CreateAssemblyReference(“System”)) .AddReferences(MetadataReference.CreateAssemblyReference(“System.Core”)) .AddReferences(new MetadataFileReference(this.GetType().Assembly.Location)) .AddSyntaxTrees(syntaxTree);
The static factory method “MetadataReference.CreateAssemblyReference” added a reference to global assemblies such as “mscorlib.dll” or “System.dll”. In the Roslyn preview, the same be achieved like so:
var assemblyPath = Path.GetDirectoryName(typeof(object).Assembly.Location); var compilation = CSharpCompilation.Create(assemblyName) .WithOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)) .AddReferences(new MetadataFileReference(Path.Combine(assemblyPath, “mscorlib.dll”))) .AddReferences(new MetadataFileReference(Path.Combine(assemblyPath, “System.dll”))) .AddReferences(new MetadataFileReference(Path.Combine(assemblyPath, “System.Core.dll”))) .AddReferences(new MetadataFileReference(Assembly.GetEntryAssembly().Location)) .AddSyntaxTrees(syntaxTree);
Seems like all the cool kids these days have converted their websites to completely static ones. I’m looking at you Mr. Haacked. I thought this was a pretty cool idea and a chance to really refresh my website so I decided to take a stab at it. It’s currently a work in progress.
I ended up writing my own tool I call Gatsby to do it. I also set up the whole deploy process myself involving pushing to Github which then informs my website to pull from the Github repository. Hopefully that will be a blog post in the not too distance future.
Sorry for any inconvenience.
Component Glue is an IoC container and you use it of course to wire up your object graphs for you. Component Glue can also build your object graphs for you automatically if there are no interfaces involved. Take this example:
In After.cs, you can see that Component Glue is able to build the entire object graph for us. This will include all future dependencies as well so long as interfaces don’t come into play. Should an interface be needed, you can just bind that single component.
This is a very powerful thing. If one component needs to take on a dependency, just ask for it in the constructor and Component Glue will handle it for you.
I finally brought Component Glue up to a state where I felt like the product was finished. You can get it via NuGet:
or you can get the source from GitHub. The documentation is definitely sparse I know but I recommend taking a look at the unit tests to get a feel for what you can do with Component Glue.
Credit for the NuGet CSS here.
I just released GLDotNet Version 0.6.0.
- **GLDotNet.Toolkit**: Assembly containing simple app framework.
- **GLDotNet.Objects**: Assembly containing higher level objects such as Texture2D and VertexBuffer.
- More overloads added to GLContext class.
- byte and sbyte are now mapped correctly in generated code.
- Fixed the naming of some functions so as not to include type notation, i.e. Color4u.
- Decreased the number of enum values output.
Today I released a project I’ve been playing around with for a year or so on Codeplex. It’s called GLDotNet. From the project description:
C# wrapper for OpenGL. Partially generated from the OpenGL spec and partially written by hand, the aim is to have a flexible and native feeling C# binding.
I have generated functions from the OpenGL spec excluding 1 or 2 but unfortunately of the generated code is untested. There is a demo project included in the source code. The Github repository is located here: https://github.com/smack0007/GLDotNet
I had a funny idea to describe HTTP Status Codes as telephone conversations so I thought I’d write it in a blog post.
- She’s not here right now but she’ll be back later.
- She doesn’t live here anymore, she now lives somewhere else.
- He hesn’t changed a bit.
- I can’t allow you to speak to him.
- $1.99 for the first minute…
- No one by that name lives here.
- It’s not you, it’s me.
- I can’t deal with this anymore.
The version of Snowball currently on GitHub under the “develop” branch has been split into multiple projects. There is now an assembly for each major piece of Snowball, such as Graphics, Input, Sound. Although this means having to reference more assemblies, the amount of code your project depends on is now smaller. This also makes code maintenance a bit easier as it’s more clear now what parts of the library depend on other parts of the library.
The parts of the library which really make up a Game Framework has also been split out into their own library. This allows for using Snowball as a just a simple set of libraries or a full blown game framework, depending on what your situation calls for.
I just want to post some information that took me while to find. Check out the original article here with pictures and more information.
1) First, download the zip file http://www.alinconstantin.net/download/VS2012Themes.zip – it contains the 7 pkgdef files defining the colors of the default themes from Matt’s extension. 2) Now, create a folder under “%ProgramFiles%\Microsoft Visual Studio 11.0\Common7\IDE\WDExpressExtensions”, and lets name it “Themes”. Unpack the zip file in that folder. 3) Open a ‘Developer Command Prompt for VS2012” window. In the command line, type “wdexpress.exe /updateconfiguration”. This will make Visual Studio to read the pkgdef files on next restart, and import the color themes into registry. 4) Launch Visual Studio Express, and now you should be able to see the new themes and switch them in Tools/Options dialog, Environment/General tab
I fixed a bug yesterday in Snowball related to a lost graphics device. I noticed that when I would use CTRL + ALT + DELETE, my apps were crashing. Turned out it was due to not recovering properly from a lost device.
The root of the problem was that I needed to call the ID3DXEffect::OnLostDevice() method when the device was being lost. This allows the effect to recover from the lost device. I’ve made the Effect class in Snowball now do this automatically.