Do any of you know if I can use the power of OpenGL for 2D drawing? As far as I think is that I should look further into projections. Have you ever tried it?
Posted Monday, 20 October, 2008 - 19:32 by Entropy
I believe the Glu.Ortho2D(...) function will set up your projection matrix for 2D drawing. I think the OpenTK examples will demonstrate its use for you, but let me know if you want some more examples and I'll see what I can dig up.
wI don't have anything too impressive, but I've got a couple of simple 2D projects using OpenTK's OpenGL bindings you can take a look at it you think it'll help.
Posted Tuesday, 21 October, 2008 - 04:26 by kanato
I've written a 2D library that uses plugins to use OpenGL or Direct3D for 2D drawing. It's at http://agate.sourceforge.net/. If you browse through the subversion you can find the 2D drawing stuff encapsulated in /trunk/drivers/AgateOTK/. Or you could just use the library (or another 2D library .NET library, there's a few out there). :)
Posted Tuesday, 21 October, 2008 - 06:52 by Entropy
@floploco: I'll post something simple when I get home tonight after work (approximately 8 hours from now). Don't expect to be impressed (and certainly don't take any programming tips from me!) but it should prove useful as a working OpenTK implementation.
@kanato: Actually I just discovered Agate last night after posting on this thread. It looks pretty interesting - I've got a project in the pipeline that I think would benefit nicely from using Agate - something a little more major than my current one (which is hardly tiny, either). I had to put it on hold for a while, though in order to a) prove to my prospective artist he wouldn't be wasting his time drawing for me and b) gain more experience in crafting something that's genuinely fun to play.
So I'll take a proper look at Agate myself soon enough.
Posted Tuesday, 21 October, 2008 - 15:31 by Entropy
As promised, here's an (extremely basic) 2D OpenTK program, which draws 2D squares and rotates them.
Like I say, it's nothing special, and you won't want to take too many tips from this, but if you're new to OpenGL it might come in handy as a basic working implementation.
Actually, I wouldn't be surprised if I get some criticism for posting this, as I'm probably much less experienced with OpenGL than a few other people on this forum, and I suspect that some of my methods might be a little inefficient or counter-intuitive.
That said, any criticism is welcome - good to know what I could improve.
Posted Wednesday, 22 October, 2008 - 00:23 by kanato
Thanks, I'm glad you guys are interested in it. If you have questions about agatelib, let me know. I check the forums there just about every day, so even though it looks dead don't let that stop you from posting.
Comments
Re: 2D In OpenGL
I believe the Glu.Ortho2D(...) function will set up your projection matrix for 2D drawing. I think the OpenTK examples will demonstrate its use for you, but let me know if you want some more examples and I'll see what I can dig up.
wI don't have anything too impressive, but I've got a couple of simple 2D projects using OpenTK's OpenGL bindings you can take a look at it you think it'll help.
Re: 2D In OpenGL
Yes please, providing me with a simple snippet would be a great help.
Thank you Entropy :)
Re: 2D In OpenGL
I've written a 2D library that uses plugins to use OpenGL or Direct3D for 2D drawing. It's at http://agate.sourceforge.net/. If you browse through the subversion you can find the 2D drawing stuff encapsulated in /trunk/drivers/AgateOTK/. Or you could just use the library (or another 2D library .NET library, there's a few out there). :)
Re: 2D In OpenGL
@floploco: I'll post something simple when I get home tonight after work (approximately 8 hours from now). Don't expect to be impressed (and certainly don't take any programming tips from me!) but it should prove useful as a working OpenTK implementation.
@kanato: Actually I just discovered Agate last night after posting on this thread. It looks pretty interesting - I've got a project in the pipeline that I think would benefit nicely from using Agate - something a little more major than my current one (which is hardly tiny, either). I had to put it on hold for a while, though in order to a) prove to my prospective artist he wouldn't be wasting his time drawing for me and b) gain more experience in crafting something that's genuinely fun to play.
So I'll take a proper look at Agate myself soon enough.
Re: 2D In OpenGL
As promised, here's an (extremely basic) 2D OpenTK program, which draws 2D squares and rotates them.
Like I say, it's nothing special, and you won't want to take too many tips from this, but if you're new to OpenGL it might come in handy as a basic working implementation.
Actually, I wouldn't be surprised if I get some criticism for posting this, as I'm probably much less experienced with OpenGL than a few other people on this forum, and I suspect that some of my methods might be a little inefficient or counter-intuitive.
That said, any criticism is welcome - good to know what I could improve.
Hope this is helpful!
Re: 2D In OpenGL
Nice one Entropy, thanks.
@Kanato
Nice library you built there, I will look further into it. :)
Re: 2D In OpenGL
Thanks, I'm glad you guys are interested in it. If you have questions about agatelib, let me know. I check the forums there just about every day, so even though it looks dead don't let that stop you from posting.