Monday, October 13, 2014

SFML Tutorial: Hello World

In this tutorial, we'll create a SFML window and draw a shape and some text, and demonstrate a basic animation.

This tutorial assumes that you already have the SFML.Net libraries and their dependencies, but we will create a new project file for this tutorial. This and all future tutorials will assume that you are using Visual Studio (however, it's definitely possible to use SFML.Net with Mono!).

A portion of the code used in this tutorial (and likely future tutorials) is taken from the official examples for SFML.Net.

Friday, October 10, 2014

Setting up SFML.Net

SMFL.Net is a binding of the Simple and Fast Multimedia Library that allows us to use its functions in C# and VB.Net. It's simple to use (hence the name) and portable (although my tutorials will only focus on Windows).

However, setting it up requires some extra work compared to some other libraries. The pre-built libraries available on the SFML website are not only a year old (so they're missing quite a few changes made since then), but the dependencies included probably won't work and one of the DLLs is MIA (technically it wasn't missing at the time, but now it's an important part of the library).

(I know things have been mostly OpenTK up until this point, but I needed a bit of a break. And if these SFML.Net tutorials go on long enough, they'll end up back in OpenTK territory, so don't worry!)

Sunday, July 13, 2014

OpenTK Tutorial 6 Part 3: Putting it all together

Now that we have TexturedCube, and a way to load shaders and textures, we can finally get to the good part, drawing some textured objects!

In this tutorial, we'll be wrapping up the texturing content. At the end, we'll have two cubes being rendered with different textures on them.

Monday, June 23, 2014

Sorry for the Delay

I'd like to apologize for how long it's taken to get the last part of the newest tutorial up. My eternal excuse is that I'm busy with work, which is true (but it's always true, welcome to life), but I don't want to put it off much longer. If I can't get a real break soon, I'll probably just make a more barebones version that has all the code, but much less commentary.

Wednesday, April 23, 2014

OpenTK Tutorial 6 Part 2: Loading Textures and the TexturedCube Class

Now that we have our shaders loaded in a new, more object-oriented way, we're a third of the way to having textured objects in our program!

In this tutorial, we'll add a function to send textures to the graphics card and write a new class to give us a cube with texture coordinates. Unfortunately, we'll need to wait for part 3 to put these to use, but I'll try to hurry it along (summer is almost here)!

Tuesday, March 11, 2014

OpenTK Tutorial 6 Part 1: Loading Shaders with a Class

This tutorial will cover basic texturing. To add a texture, we will first need to have a shader that handles it. Right now, we're using one shader, with no way to easily switch to another without requiring everything to use that shader. In a real game or program, we would probably want to be able to use multiple shaders (for example, UI elements probably don't need lighting applied to them, but game objects probably do), so we're going to handle this with a class that allows us to easily add more shaders if we need them, and switch between them at will.

This tutorial is split in parts, based on how long it is. Each step is rather substantial (and this groundwork will make things easier down the line), so I hope everyone understands why it needed to be split up like this.

Tuesday, February 18, 2014

Minor tutorial update

Since OpenTK 1.1 is officially out now, the tutorials have been updated to use it. There's a minor change to the Program class in all of them, which is required for them to run (thanks to an anonymous commenter for pointing it out). Other than that, Tutorial 5 is the only one with major changes, which make it no longer reliant on System.Windows.Forms, instead using the new OpenTK.Input classes.