• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
PnP Bios

@SDL users, use OpenGL

92 posts in this topic

Don't get me wrong. SDL is wonderfull for 2d graphics, to a point. But, there are just some things that can't be ignored. 1) Software rendering in many cases is faster than hardware rendering. Does this seem wrong to anybody else? 2) No stretch blitting, No blending other than alpha, and no rotation. A super nintendo has hardware level support for this, so why not PC's? Oh, wait, they do... 3) It is slow. No matter how you look at it, speed is always going to be an issue. What can't be done in hardware has to be done in software, and sometimes, there isn't even support for hardware level functions at all. Last time I looked, Direct Draw, heck, even the GDI had support for stretched blitting. There is a soft stretch function, but I had to dig deep into the source to find it. Ok, now you are all mad because I exposed the flaws. But don't be. Doing 2d in OpenGL requires a bit more setup at first, but the rewards are worth the effort. Some of you are aware of a library I have been working on. Drew and Wryzy have helped me a ton working on it. I have called it hxRender. Now, there are 2 ways you can use this. As I have included all the source, you can use that as a tutorial to build your own framework, or you can use the libraries I have provided. As of right now, there is no documentation, and there are no samples. I am writing a sample program right now to demonstrate the capabilities of this library. In theory, it is almost identical to SDL's built in rendering package, except where I have added functionality. There are 3 libraries, hxRender, which handles all of the OpenGL rendering. hxSDL, which provides an interface to integrate with SDL for window setup, and hxUtility, which fills the gaps of whatever else doesn't fit. I built almost all of it from scratch, I have given credit where it is due for the stuff I couldn't do on my own, as much as I can remember anyways.. If you feel you deserve credit for someting, PM me and let me know so I can give it where it is due. If you have any questions, feel free to ask them here, PM me, or send me an email. Thanks. Here it is for download. hxRender version 0.7 (18.3KB) If anybody wants to port to linux, that would be great. [Edited by - PnP Bios on January 9, 2005 1:43:46 PM]
0

Share this post


Link to post
Share on other sites
Of course, may I ask whether it supports resolution-independent sprite rendering and what sort of calls you are making to OpenGL? May I also ask if you have to be worried about texture switching to get good performance? The thing about SDL is that you don't have to worry about the number of surfaces or the size of the surfaces.
0

Share this post


Link to post
Share on other sites
I, like many SDL users, are just starting out.

sure 50 fps may suck, but its not like speed is super critical for a tetris clone =P

I do plan to use OpenGL eventually, but right now I'm worried about making a box for string input. So I'll just stick with the easy to use SDL.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Lazy Foo
I, like many SDL users, are just starting out.

sure 50 fps may suck, but its not like speed is super critical for a tetris clone =P

I do plan to use OpenGL eventually, but right now I'm worried about making a box for string input. So I'll just stick with the easy to use SDL.
his library looks almost exactly like SDL, so, it won't be any harder(read his post)
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Boder
Of course, may I ask whether it supports resolution-independent sprite rendering and what sort of calls you are making to OpenGL? May I also ask if you have to be worried about texture switching to get good performance? The thing about SDL is that you don't have to worry about the number of surfaces or the size of the surfaces.


Resolution independence is a big factor. All of the image data is stored as RGBA regardless of the resolution. Currently, the library supports up to 256 independenant textures. My library even handles non-power-of-two images. I have sacrificed using the depth buffer and lighting as a trade off for using different textures.

No good programmer would need more than 64 megs of ram for texture data at any given time for a 2d game.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by PnP Bios
Here it is for download.
hxRender version 0.7 (18.3KB)

If anybody wants to port to linux, that would be great.


Why don't you set up a simple website for this lib? Sourceforge maybe? Write down a list of tasks people can be assigned to. I would like to get involved in a project like this in my spare time... But I don't want to start porting your library and then come back here and see someone else beated me to it.

EDIT:

Quote:
No good programmer would need more than 64 megs of ram for texture data at any given time for a 2d game.


Generalizations are dangerous...
0

Share this post


Link to post
Share on other sites
Thanks a bunch, Joel. Although I think SDL is a wonderful thing for beginners to use, I have to agree that once you're done with it and are confident enough, moving onto a something different is necessary.
0

Share this post


Link to post
Share on other sites
Nice job, PnP, and keep it up.

After going through the source, I would like to make a suggestion. After doing some unit testing, I have found that calling glBegin() glEnd() too many times slows things down. Since this engine is directed towards 2D users, I would assume some people would use it for a Tile-Based Game. Often in tile-based games, you'll draw the same texture quite a few times per frame, so I would suggest incorporating a function that would set the texture and then allow users to draw with the current texture.

(Note: If you think this makes things too complicated, you may want to leave it out)
Maybe something like:
//////////////////
hxSetActiveTexture( hxSurface* s ) { glBindTexture( GL_TEXTURE_2D, hxTexList[s->texID] ); glBegin(GL_QUADS); }
/////////////////
hxBlitWithActiveTexture( hxBlitRect sRect, hxBlitRect dRect )
{
float sx = 0.0;
float sy = 0.0;
float sw = 0.0;
float sh = 0.0;
sx = (float)sRect.x/(float)source->wPad;
sy = (float)sRect.y/(float)source->hPad;
sw = (float)(sRect.x+sRect.w)/(float)(source->wPad);
sh = (float)(sRect.y+sRect.h)/(float)(source->hPad);

glTexCoord2f(sx, sy); glVertex2i(dRect.x, dRect.y);
glTexCoord2f(sw, sy); glVertex2i(dRect.x + dRect.w, dRect.y);
glTexCoord2f(sw, sh); glVertex2i(dRect.x + dRect.w, dRect.y + dRect.h);
glTexCoord2f(sx, sh); glVertex2i(dRect.x, dRect.y + dRect.h);
}
/////////////////
hxFinishedWithActiveTexture() { glEnd(); }
////////////////

Its just a thought, but it would probably really increase the speed of drawing if you were doing a tile-based game and drawing like 200 ground tiles, 400 sky tiles, 7 tiles that were the same enemy ....
0

Share this post


Link to post
Share on other sites
Wryzy, With your example with the tile map, I would be assuming that they would be pulling all the tiles off of the same texture anyways. But, you guys are right, assumptions are dangerous. The goal of this is to make OpenGL as transparent to the user as possible. The way I would handle it, would be to see if the texture being used this call was the same one used last call. So, yeah, I see your point.

Ok, this is what I need done, as far as I can tell. I need a web site, that much is a given. I also want to be able to export these as DLL's. So if we do make significant gains in speed, it won't be a pain for the user to upgrade. I also need documentation. I have played around with doxygen, but... That's just not what I want. Perhaps a WIKI would be approriate for this.

*nix people... What should we do for you guys? same for you mac people. I'm fine with it being win32, but if more people can use it, that's great too.

This is going to be giftware, I have decided. If you are going to use it, give me credit if you want to, otherwise I can't enforce it. Do whatever you want with it.
0

Share this post


Link to post
Share on other sites
- Very, if not most, important part of a coding library is it's documentation. Many people make their choice based on that.
- There is basically no point in making a wrapper that doesn't add any functionality. Although it's a good personal exercise.

Anyway, I look forward to more of your tutorials, if you're planning on making those.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by PnP Bios
*nix people... What should we do for you guys? same for you mac people. I'm fine with it being win32, but if more people can use it, that's great too.


I'll try to port it to linux as soon as I get my monitor back (or I buy a new one). If you know someone else already doing it, drop me a line, so I won't expend that time doing redundant work.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by PnP Bios
Ok, this is what I need done, as far as I can tell. I need a web site, that much is a given. I also want to be able to export these as DLL's. So if we do make significant gains in speed, it won't be a pain for the user to upgrade. I also need documentation. I have played around with doxygen, but... That's just not what I want. Perhaps a WIKI would be approriate for this.

I would take the recommendation of owl and look into source forge. They seem to offer space for almost any open source project. You may be able to find a free Wiki off Google but I don't know of any off hand. I think source forge is reliable and it would probably be a good idea to go with them. What are you looking for in documentation? Doxygen is pretty nice, IMO, and it tells you which function you need for what.

As far as exporting as .dll's, if you don't know how to do that I would just open up one of your SDL header files. Its not really complicated, but it just looked "cryptic" the first time I saw it. You may already know what you need to do.
0

Share this post


Link to post
Share on other sites
Owl, port away.
Wryzy, I will look into source forge later today, as well as a doc wiki. What I don't like about doxygen is getting it to work with my editor. Dreamweaver, yum.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by PnP Bios

. . .snip. . .

If anybody wants to port to linux, that would be great.


SDL already works on Linux, as well as BSD, OSX, and MacOS classic. It also works on platforms that don't support OpenGL, like PocketPC and Symbian.

If you want to trumpet your own library, let it live on its own merits. Don't start out by pointing out the inadequacies of the competition unless your solution can win on all fronts. . .which would then make cutting down the competition unnecessary.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by johnhattan
Quote:
Original post by PnP Bios

. . .snip. . .

If anybody wants to port to linux, that would be great.


SDL already works on Linux, as well as BSD, OSX, and MacOS classic. It also works on platforms that don't support OpenGL, like PocketPC and Symbian.

If you want to trumpet your own library, let it live on its own merits. Don't start out by pointing out the inadequacies of the competition unless your solution can win on all fronts. . .which would then make cutting down the competition unnecessary.


That's fair enough. Anyway I think OP meant OpenGL being better than SDL in the terms of OpenGL having hardware acceleration support. Beyond that and neededles to say, I don't expect his 8-header-files-long library to be more complete or more crossplatform than SDL and it's agregates.

EDIT: @PnP Bios, if you want people to help you out with your project you better show them it is under the GPL license. Otherwise they would be working for free and wouldn't have the right to own a copy if you or anybody else copyrights the source code.
0

Share this post


Link to post
Share on other sites
I registered it under LGPL with source forge. I hope that is good enough.

I don't know jack shit about licensing, software law, or anything like that. You want it GPL, sure, I don't care. Just show me what to do.
0

Share this post


Link to post
Share on other sites
I do agree that it would be a great idea to use OpenGL over SDL for graphics but think about the people just starting out. Some of the things in OpenGL wouldn't make any sense to them at all. Examples of this include setting a orthogonal projection, alternating between matrix modes, etc.

SDL is super simple that is why it doesn't support some of the advance features, like stretch-blitting, that DirectDraw so proudly supports.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Khaosifix
I do agree that it would be a great idea to use OpenGL over SDL for graphics but think about the people just starting out. Some of the things in OpenGL wouldn't make any sense to them at all. Examples of this include setting a orthogonal projection, alternating between matrix modes, etc.

SDL is super simple that is why it doesn't support some of the advance features, like stretch-blitting, that DirectDraw so proudly supports.


Anybody using my library wouldn't even know that they are using OpenGL. Did you even look through the source?
0

Share this post


Link to post
Share on other sites
Quote:
Original post by PnP Bios
Quote:
Original post by Khaosifix
I do agree that it would be a great idea to use OpenGL over SDL for graphics but think about the people just starting out. Some of the things in OpenGL wouldn't make any sense to them at all. Examples of this include setting a orthogonal projection, alternating between matrix modes, etc.

SDL is super simple that is why it doesn't support some of the advance features, like stretch-blitting, that DirectDraw so proudly supports.


Anybody using my library wouldn't even know that they are using OpenGL. Did you even look through the source?


No I don't need to. I'm comfortable with OpenGL. Thank you.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Khaosifix
Quote:
Original post by PnP Bios
Quote:
Original post by Khaosifix
I do agree that it would be a great idea to use OpenGL over SDL for graphics but think about the people just starting out. Some of the things in OpenGL wouldn't make any sense to them at all. Examples of this include setting a orthogonal projection, alternating between matrix modes, etc.

SDL is super simple that is why it doesn't support some of the advance features, like stretch-blitting, that DirectDraw so proudly supports.


Anybody using my library wouldn't even know that they are using OpenGL. Did you even look through the source?


No I don't need to. I'm comfortable with OpenGL. Thank you.

If you have a point, make it quick.
0

Share this post


Link to post
Share on other sites
You didn't have to rate me down for that. People like you make it less enjoyable to post on these forums. Good day.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by PnP Bios
I registered it under LGPL with source forge. I hope that is good enough.

I don't know jack shit about licensing, software law, or anything like that. You want it GPL, sure, I don't care. Just show me what to do.



You can copyright the code or just release it as you did here to the public domain, but you must add a notice with it saying that it is indeed free.

Quote:

Public Domain Software
(Free Software)

If a program is free software when it leaves the hands of its author, this does not necessarily mean it will be free software for everyone who has a copy of it.

For example, public domain software (software that is not copyrighted) is free software; but anyone can make a proprietary modified version of it. Likewise, many free programs are copyrighted but distributed under simple permissive licenses which allow proprietary modified versions.

The paradigmatic example of this problem is the X Window System. Developed at MIT, and released as free software with a permissive license, it was soon adopted by various computer companies. They added X to their proprietary Unix systems, in binary form only, and covered by the same nondisclosure agreement. These copies of X were no more free software than Unix was.

The developers of the X Window System did not consider this a problem--they expected and intended this to happen. Their goal was not freedom, just "success", defined as "having many users." They did not care whether these users had freedom, only that they should be numerous.

This lead to a paradoxical situation where two different ways of counting the amount of freedom gave different answers to the question, "Is this program free?" If you judged based on the freedom provided by the distribution terms of the MIT release, you would say that X was free software. But if you measured the freedom of the average user of X, you would have to say it was proprietary software. Most X users were running the proprietary versions that came with Unix systems, not the free version.


Quote:

Copyleft and the GNU GPL
(Free Software enforced)

The goal of GNU was to give users freedom, not just to be popular. So we needed to use distribution terms that would prevent GNU software from being turned into proprietary software. The method we use is called "copyleft".(1)

Copyleft uses copyright law, but flips it over to serve the opposite of its usual purpose: instead of a means of privatizing software, it becomes a means of keeping software free.

The central idea of copyleft is that we give everyone permission to run the program, copy the program, modify the program, and distribute modified versions--but not permission to add restrictions of their own. Thus, the crucial freedoms that define "free software" are guaranteed to everyone who has a copy; they become inalienable rights.


Your package must include what is mentioned here:
Quote:

* Attach a copyright notice to all files. Minimally, each source file should include at least the copyright line and a pointer to where the full notice is found.

* Add information about how to contact you by email or normal paper mail.

* Add a file called COPYING to your source distribution which contains a copy of the whole license.

* If your program is interactive you should also display prominently the fact that the software is distributed under the terms of the GPL and carried no warranty with it.

* A README file should also guide the user to this fact as well as to the whole license in the COPYING file.

* Sometimes it is also a good idea to include a disclaimer from your employer or school, if applicatble.


Here the Free Software Fundation site

Here the LGPL text that should go with every package of your project.

[Edited by - owl on January 7, 2005 1:28:11 PM]
0

Share this post


Link to post
Share on other sites
Khaosfix, if you want fun, stay in the lounge. Don't crap up threads. Thats all the more I will say about it.

Owl, thanks. I will get on this as soon as the next time I am in front of my code. I should hear back from SF on if I get a page for this before sunday, hopefully.
0

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0