View Single Post
Old 10-14-2014, 11:16 AM
dotnetwrassler dotnetwrassler is offline
Join Date: Sep 2014
Location: USA (Pacific/West Coast)
Posts: 71
Default A "no go" for SlimDX..maybe try OpenGL?

After many weeks spent downloading all the VB.Net SlimDX samples I could find on the Internet I haven't found any that actually worked on my computer (and it's not my computer's video card because it supports DirectX 9/10/11 using XNA and OpenGL 2.0+, see below).
Also, by the way - there are only 7 threads that I found on the forum that mention "SlimDX" (including this one), and none of them had any working code.

SlimDX (using C#) does make for some nice screenshots, though:

Most of the XNA code I translated from C# to VB.Net had issues --too much use of unsafe (unmanaged) code calls,
and those samples I did manage to get to work didn't have scene graph support. (A very important limitation --please take note, Microsoft!)

So what actually does work to create 3D using VB.Net?
It's simple (if a bit ironic, since it's definitely not a Microsoft thing): OpenGL.

The best OpenGL wrapper for VB.Net seems to be the Tao Framework.

There are already some working samples that use this wrapper on the forum attached to this post by someone from Hungary named "martonx":

CsGL is the alternate wrapper for using OpenGL with VB.Net (although most of the sample code on the internet using this wrapper is in C#).
Here's some VB.Net code for CsGL though:

However, since neither of the martonx demos (linked to above) used textures,
I wondered if there was a way to do OpenGL with texture loading (possibly without using pre-compiled 3rd party .dll wrappers)?

After long hours searching I finally found a sample /demo that did exactly that.
The screenshot and working code are attached below.

The main limitation - it uses WndProc to create the window instead of a standard VB.Net form, but if that's a way forward..

As a final thought --I also found some nice VB.Net code for doing 4 point quadrilateral distortion of textures (something beyond the GDI+ DrawImage API's inadequate 3 point skewing).

I'm also going to play around to see if I can make a 3D textured cube with that..but that's another thread (for later).
Attached Images
File Type: jpg Screenshot_OpenGL_pure_VB_dot_Net_demo.JPG (37.4 KB, 3 views)
Attached Files
File Type: zip (856.6 KB, 7 views)
Reply With Quote