{"id":637,"date":"2008-10-20T14:01:14","date_gmt":"2008-10-20T14:01:14","guid":{"rendered":"http:\/\/www.icemark.com\/blog\/?p=637"},"modified":"2011-03-08T08:55:49","modified_gmt":"2011-03-08T08:55:49","slug":"timbles-xna-directx-and-slimdx","status":"publish","type":"post","link":"https:\/\/www.icemark.com\/blog\/archives\/2008\/10\/20\/timbles-xna-directx-and-slimdx\/","title":{"rendered":"Timbles, XNA, DirectX, and SlimDX"},"content":{"rendered":"<p>I&#8217;ve written some game code over the years. I joined SCi back in 1994 over the following 14 years I&#8217;ve written a fair few applications in C++ and utilised DirectX. When I started at SCi DirectX wasn&#8217;t out and we were still working with various graphics and audio libraries that gave you access to the plethera of hardware that was available. When DirectX was release in &#8217;95 if was a godsend.<\/p>\n<p>I haven&#8217;t written any game code on windows for a few years now and so coming back to it I spent a little moment thinking about what I wanted to achieve.<\/p>\n<p><a target=\"_blank\" alt=\"DirectX\" title=\"DirectX\" href=\"http:\/\/en.wikipedia.org\/wiki\/DirectX\" rel=\"tag\">DirectX<\/a> has now pretty much been replaced with <a target=\"_blank\" alt=\"XNA\" title=\"XNA\" href=\"http:\/\/en.wikipedia.org\/wiki\/XNA\" rel=\"tag\">XNA<\/a>. Replaced is a loose term there because of course DirectX is still available as a low level library &#8211; but <a target=\"_blank\" alt=\"Microsoft\" title=\"Microsoft\" href=\"http:\/\/en.wikipedia.org\/wiki\/Microsoft\" rel=\"tag\">Microsoft<\/a> have a large push on the XNA technologies.  XNA allows you to develop game code in c# that targets windows, zune, and xbox 360. Now I know there will be a lot of pure programmers out there who would despair the concept of coding in c#, but hey, things move on. I&#8217;m getting a bit long in the tooth now and coding in C++ really doesn&#8217;t interest me anymore. <\/p>\n<p>So I like the concept of XNA and C# &#8211; apart from two things &#8211; the minimum requirement and the platform dependence. You have to have a graphics card that has shader model 1.1 support. The laptop that I am typing this on &#8211; doesn&#8217;t!<\/p>\n<p>I&#8217;m writing a 2d sprite based game. I want to use the graphics card to do all the work for me &#8211; why not, it can throw millions of textured polygons around the screen, so it will have no problem with my sprites &#8211; so why do I *need* shader model 1.1? Basically, that rules XNA out for me. <\/p>\n<p>With regard platform dependence &#8211; I can target XNA using C++ if I use managed code. To be honest, after doing it, see my previous point &#8211; I can&#8217;t be arsed! Thinking about my target audience &#8211; really platform independance is not a major thing &#8211; the majority of them will be windows based. I intend to do a Mac version, but that can come later, and to be honest, porting from VB\/c# to C++ or Objective-C &#8211; isn&#8217;t such a big issue.<\/p>\n<p>DirectX can be used using managed directx. This is a way of accessing the libraries using c# or vb.net. It works well&#8230; I hade the prototype up and running pretty quickly using it &#8211; one problem &#8211; it&#8217;s discontinued in favour of XNA!<\/p>\n<p>So that brings me to SlimDX. SlimDX is affectively a cross between XNA and Managed DirectX. It works a treat and doesn&#8217;t have the shader issue. So I have Timbles up and running in SlimDX very nicely!<\/p>\n<p>This brings me back to another thing &#8211; the choice of language. <a href=\"http:\/\/www.icemark.com\/blog\/archives\/2008\/10\/17\/timbles-net\/\">As I mentioned earlier<\/a> I coded the prototype in VB. After a little while of playing around, I made a decision: I&#8217;m going to leave the game in VB &#8211; why &#8211; well why not? The game is already up and running. I&#8217;m using the hardware for the audio and graphics. Thus the game logic doesn&#8217;t actually spend much time running in a update cycle. So why should I spend any time messing around trying to put it into another language. I actually prefer VB over c# &#8211; just because it&#8217;s simpler and there is nothing I can&#8217;t do in VB that I need c# for.<\/p>\n<p>So the prototype has just moved to production code!<\/p>\n<a href=\"http:\/\/technorati.com\/tags\/\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.icemark.com\/blog\/wp-images\/technorati_small.gif\" width=\"16\" height=\"15\" alt=\"Technorati\"\/><\/a> <a target=\"_blank\" alt=\"DirectX\" title=\"DirectX\" href=\"http:\/\/technorati.com\/tag\/DirectX\" rel=\"tag\" >DirectX<\/a>, <a target=\"_blank\" alt=\"XNA\" title=\"XNA\" href=\"http:\/\/technorati.com\/tag\/XNA\" rel=\"tag\" >XNA<\/a>, <a target=\"_blank\" alt=\"Microsoft\" title=\"Microsoft\" href=\"http:\/\/technorati.com\/tag\/Microsoft\" rel=\"tag\" >Microsoft<\/a><br\/><a href=\"http:\/\/en.wikipedia.org\/\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.icemark.com\/blog\/wp-images\/wiki_small.gif\" width=\"16\" height=\"16\" alt=\"Wikipedia\"\/><\/a> <a target=\"_blank\" alt=\"DirectX\" title=\"DirectX\" href=\"http:\/\/en.wikipedia.org\/wiki\/DirectX\">DirectX<\/a>, <a target=\"_blank\" alt=\"XNA\" title=\"XNA\" href=\"http:\/\/en.wikipedia.org\/wiki\/XNA\">XNA<\/a>, <a target=\"_blank\" alt=\"Microsoft\" title=\"Microsoft\" href=\"http:\/\/en.wikipedia.org\/wiki\/Microsoft\">Microsoft<\/a><h3 class='related_post_title'>Related Posts:<\/h3><ul class='related_post'><li><a href=\"http:\/\/www.icemark.com\/blog\/archives\/2013\/07\/01\/timbles-week-3\/\" title=\"Timbles &#8211; Week 3\">Timbles &#8211; Week 3<\/a><\/li><li><a href=\"http:\/\/www.icemark.com\/blog\/archives\/2013\/06\/24\/timbles-week-2\/\" title=\"Timbles &#8211; Week 2\">Timbles &#8211; Week 2<\/a><\/li><li><a href=\"http:\/\/www.icemark.com\/blog\/archives\/2009\/04\/09\/timbles-silverlight\/\" title=\"Timbles Silverlight\">Timbles Silverlight<\/a><\/li><li><a href=\"http:\/\/www.icemark.com\/blog\/archives\/2008\/10\/17\/timbles-net\/\" title=\"Timbles &#038; .Net\">Timbles &#038; .Net<\/a><\/li><li><a href=\"http:\/\/www.icemark.com\/blog\/archives\/2008\/10\/16\/timbles\/\" title=\"Timbles\">Timbles<\/a><\/li><\/ul>","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve written some game code over the years. I joined SCi back in 1994 over the following 14 years I&#8217;ve written a fair few applications in C++ and utilised DirectX. When I started at SCi DirectX wasn&#8217;t out and we were still working with various graphics and audio libraries that gave you access to the &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.icemark.com\/blog\/archives\/2008\/10\/20\/timbles-xna-directx-and-slimdx\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Timbles, XNA, DirectX, and SlimDX&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_newsletter_tier_id":0,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[21,11,87],"tags":[178,152,252],"class_list":["post-637","post","type-post","status-publish","format-standard","hentry","category-coding","category-technology","category-timbles","tag-directx","tag-programming","tag-timbles"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pwn4r-ah","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.icemark.com\/blog\/wp-json\/wp\/v2\/posts\/637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.icemark.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.icemark.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.icemark.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.icemark.com\/blog\/wp-json\/wp\/v2\/comments?post=637"}],"version-history":[{"count":7,"href":"https:\/\/www.icemark.com\/blog\/wp-json\/wp\/v2\/posts\/637\/revisions"}],"predecessor-version":[{"id":908,"href":"https:\/\/www.icemark.com\/blog\/wp-json\/wp\/v2\/posts\/637\/revisions\/908"}],"wp:attachment":[{"href":"https:\/\/www.icemark.com\/blog\/wp-json\/wp\/v2\/media?parent=637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.icemark.com\/blog\/wp-json\/wp\/v2\/categories?post=637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.icemark.com\/blog\/wp-json\/wp\/v2\/tags?post=637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}