SFML community forums

Bindings - other languages => DotNet => Topic started by: Joseph on February 25, 2014, 05:35:12 pm

Title: SFML RenderTextures and OpenGL
Post by: Joseph on February 25, 2014, 05:35:12 pm
Hello!

So I've had an idea for a game that I want to develop when I go back to university later this year and I'd like to use the SFML .net library (Because I've been using it quite a bit lately and already have plenty of nice code I can continue using).

But I'm not sure whether it is possible at the moment, so here it is: I want to make a 2d platformer, only the 2d scenes are actually on the 6 different sides of a 3D cube that can be rotated with the mouse.

So, using SFML .net and OpenGL am I able to create a 3D cube in OpenGL and then texture each face of the cube using a RenderTexture from SFML?

If that didn't make sense then I can draw you some terrible diagrams which will be equally confusing :D

Thanks!
Title: Re: SFML RenderTextures and OpenGL
Post by: Nexus on February 25, 2014, 05:40:42 pm
Yes, you can. When drawing the cube's vertices, bind the texture from the SFML render texture (with the RenderTexture.GetTexture() and Texture.Bind() methods, assuming they're named analogously to their C++ equivalents).
Title: Re: SFML RenderTextures and OpenGL
Post by: Joseph on February 25, 2014, 05:55:44 pm
Brilliant :D

It's going to be a while until I actually implement this so I might end up being a bit cheeky and asking for help somewhere down the line.
Title: Re: SFML RenderTextures and OpenGL
Post by: zsbzsb on February 25, 2014, 07:51:56 pm
Yes, you can. When drawing the cube's vertices, bind the texture from the SFML render texture (with the RenderTexture.GetTexture() and Texture.Bind() methods, assuming they're named analogously to their C++ equivalents).

Actually it is a property so RenderTexture.Texture is what you are after. And yes the Texture.Bind() is correct.  ;)