Upgrading to WordPress 3.0 – let me know if any of you experience any issues. Thanks.
Edit: Updated. Everything seem okay?
Upgrading to WordPress 3.0 – let me know if any of you experience any issues. Thanks.
Edit: Updated. Everything seem okay?
I’m just kind of throwing this idea out there – but would any of you benefit from video tutorials with me explaining things as each tutorial is coded?
As an aside, here’s a quick plug for Skylar Payne. He has made some video tutorials that you can check out:
The new tutorials are well under way (I’ve decided to make a side-tutorial for game states, but it’s tightly integrated into the space shooter tutorial). But while we’re waiting for that, I think I’d like to run another contest. But before we get to any sort of contest announcement, I’d like to get everyone’s ideas out there on what we should do. Donations are also welcome that will be pooled directly into a contest prize.
Here’s a quick tip that is useful if you are sending data over a network. If you ever messed with any sockets in programming then you know you can only send bytes of data. Why is this problem? Well, you can’t exactly send over a 4 byte integer in a single 1 byte char. To get around this, we do something called packing.
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
Buffer[0] = (Data >> 24) & 0xFF;
Buffer[1] = (Data >> 16) & 0xFF;
Buffer[2] = (Data >> 8) & 0xFF;
Buffer[3] = (Data) & 0xFF;
#elseif
Buffer[3] = (Data >> 24) & 0xFF;
Buffer[2] = (Data >> 16) & 0xFF;
Buffer[1] = (Data >> 8) & 0xFF;
Buffer[0] = (Data) & 0xFF;
#endif
Now, we can easily send over the Buffer char array. Two things to note here. First, depending on the system you are working on, the endianness can change (to read up on what endianness is, look here: http://en.wikipedia.org/wiki/Endianness) – that is what the #if SDL_BYTEORDER == SDL_BIG_ENDIAN statement is for. Secondly, we did nothing here to specify if the data being packed is signed or unsigned. You will need to know on the other end what type of data you are receiving.
Here’s how you can unpack this data:
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
Data = ((((Uint8 *)Buffer)[0] << 24) | (((Uint8 *)Buffer)[1] << 16) | (((Uint8 *)Buffer)[2] << 8) | ((Uint8 *)Buffer)[3] << 0);
#elseif
Data = ((((Uint8 *)Buffer)[3] << 24) | (((Uint8 *)Buffer)[2] << 16) | (((Uint8 *)Buffer)[1] << 8) | ((Uint8 *)Buffer)[0] << 0);
#endif
Official SDL announcment:
Announcing the latest release of SDL_ttf!
http://www.libsdl.org/projects/SDL_ttf/
CHANGES:
* Find the Unicode or symbol character map if it’s available in the font
* Set the appropriate font styles for bold and italic fonts
* Added font style TTF_STYLE_STRIKETHROUGH
* Fixed size calculations taking outline and underline into account
* Added API for font outlining: TTF_GetFontOutline()/TTF_SetFontOutline()
* Added API to disable kerning: TTF_GetFontKerning()/TTF_SetFontKerning()
* Fixed height calculation for fonts that extend below the font height
* Added access to font hinting: TTF_GetFontHinting()/TTF_SetFontHinting()
* Added TTF_GlyphIsProvided() to check whether a glyph is in a given font
Thanks to everybody who contributed feedback and patches for this release!
–
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC
I’m pondering over what tutorial should be next. What do you think should be next?
Update:
I think it’s pretty obvious. I’ll go for making the space shooter the next tutorials. Bits and pieces will be taken from Ace of Space (of course). I may throw in Game States in the same tutorial, or make a side tutorial (as it would be relevant here).
Thanks everyone.
A common area that people don’t even know exist in C++, is called literals or literal constants. But even though you may not have heard of the term before, you no doubt have been using them all the time. For example, 2.0f is a float literal, while 2.0 is a double literal. 0×1 is a hex int literal, while 0x1L is a long int literal. This is important to remember, especially when precision and data size is involved. You may be losing out on data, and you didn’t even know you were!
Here’s a quick table run-down, taken from http://cpp.comsci.us/etymology/literals.html.
| Type | Base | Example | Description |
|---|---|---|---|
| char * | ASCII | “hello” | Any string of characters enclosed in double quotes (“) (see Note 1) |
| char | ASCII | ’1′ | One character in single quotes (‘) |
| unsigned short int | ASCII | L’ab’ | One or two characters in single quotes (‘), preceded by the letter L |
| int | octal | 01 | Any octal number (digits 0-7) beginning with a 0 (zero) |
| decimal | 1 | Any decimal number (digits 0-9) not beginning with a 0 (zero) |
|
| hexadecimal | 0×1 | 0X (zero X) or 0x (zero x) followed by any hexadecimal number (digits 0-F) |
|
| ASCII | ‘ABC’ | Two to four characters in single quotes (‘) | |
| unsigned int | octal | 01U | Any octal number (digits 0-7) beginning with a 0 (zero) and followed by U or u |
| decimal | 1U | Any decimal number (digits 0-9) not beginning with a 0 (zero) and followed by U or u |
|
| hexadecimal | 0x1U | 0X (zero X) or 0x (zero x) followed by any hexadecimal number (digits 0-F) and followed by U or u |
|
| long int | octal | 01L | Any octal number (digits 0-7) beginning with a 0 (zero) and followed by L or l |
| decimal | 1L | Any decimal number (digits 0-9) not beginning with a 0 (zero) and followed by L or l |
|
| hexadecimal | 0x1L | 0X (zero X) or 0x (zero x) followed by any hexadecimal number (digits 0-F) and followed by L or l |
|
| unsigned long int | octal | 01UL | Any octal number (digits 0-7) beginning with a 0 (zero) and followed by U or u and L or l |
| decimal | 1UL | Any decimal number (digits 0-9) not beginning with a 0 (zero) and followed by U or u and L or l |
|
| hexadecimal | 0x1UL | 0X (zero X) or 0x (zero x) followed by any hexadecimal number (digits 0-F) and followed by U or u and L or l |
|
| float | decimal | 12.3F | Any number (digits 0-9) containing a decimal point (.) and followed by F or f |
| decimal | 12E1F | Any number (digits 0-9) followed by E or e, followed by an exponent of 10 (12E1 = 12 * 101 = 120.), and followed by F or f |
|
| double | decimal | 12.3 | Any number (digits 0-9) containing a decimal point (.) |
| decimal | 12E1 | Any number (digits 0-9) followed by E or e and followed by an exponent of 10 (12E1 = 12 * 101 = 120.) |
|
| long double | decimal | 12.3L | Any number (digits 0-9) containing a decimal point (.) and followed by L or l |
| decimal | 12E1L | Any number (digits 0-9) followed by E or e, followed by an exponent of 10 (12E1 = 12 * 101 = 120.), and followed by L or l |
|
| Notes: String constants are stored as the literal characters followed by a byte of binary 0. The value returned is a pointer to the first character. |
|||
In this new tutorial series, we will be looking at using SDL along with OpenGL. SDL as it stands is nice for basic 2D graphics/composition, but when it comes to more intensive gaming applications or 3D graphics, we need to leverage the use of other libraries. SDL works so well with OpenGL because we can use OpenGL to manage only graphical rendering, and leave SDL for everything else (Events, Window management, etc).
This post is part of something new I will be doing every once in a while. I will choose at random from a bunch of SDL libraries (that are good) and feature them here for all of you to check out. Today, we have a library called Net2 created by Bob Pendleton. He has been a frequent SDL contributor for quite a while now, and if you’ve ever subscribed to the SDL Mailing List, you probably have seen emails from him.
Alright everyone, it’s your turn to take a look at the contest entries and let me know what you think. Vote for the one you like best, and let us know in the comments what you like / dislike.
Bloc

Download
Blockzorz

Download
Falling in Pieces

Download
Tetris with a Twist

Download
Yage

Download
Zeetrix

Download
Check this out. 5 indie games for any price you specify. Games are World of Goo, Aquaria, Gish, Lugaru, and Penumbra. Money goes toward the developers, charity, or EFF (and can be split however you want). Please be a generous giver for this awesome opportunity.
P.S.
Time is running out on this bundle – about 5 days left.
A lot of you out there are working on the next “big” game. Often, you’ll find yourself without the necessary resources to finish your game. Usually this means you just plain suck at graphics or audio, and don’t have the skills to pull anything cool together. Here’s my list of top websites to go to if you are need of some resources for your game. Please keep in mind some of these sites can be used for commercial purposes, while others cannot.
Sprites
http://sdb.drshnaps.com/
http://www.spriters-resource.com/
http://opengameart.org/
http://charas-project.net/
Textures
http://mayang.com/textures/
http://www.cgtextures.com/
http://www.morguefile.com/
http://www.turbosquid.com/Textures
http://www.deviantart.com/ (Also might find some sprites here)
Music
http://ocremix.org/
Sound Effects
http://www.soundjay.com/
http://www.a1freesoundeffects.com/
Fonts
http://www.dafont.com/
Got a cool website to share? Let us know in the comments.
Arguably no other area of C++ confuses more people and causes more frustration than pointers. Here’s a few quick tips to keep safe while using them.
Official SDL Announcement:
We had some amazing applicants for this year’s Google Summer of Code, and I would like to thank everyone who applied. It was very difficult to narrow down the final list, but in the end we picked 5 excellent students for this year’s project.
I’d like to introduce them and invite everyone to welcome them to the SDL community!
Introducing the Students:
* Daniel Wyatt is working on the Windows IME implementation, working with Jiang (a GSoC student from last year) to update the API and build working Japanese input support. I will be mentoring Danial and coordinating his collaboration with Jiang. You can find out more
about his project at:
http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/sdl/t127230762719
* Eli Gottlieb is working on shaped window support for Linux, Mac OS X, and Windows. He will be mentored by Andreas Schiffler, who has
actually implemented shaped window support for commercial SDL projects. You can find out more about his project at:
http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/sdl/t127230762740
* Jim Grandpre is working on adding support for multi-touch devices and developing a complete gesture recognition framework. He will be mentored by Ryan Gordon, who among many other things, is working on porting games to the iPad. You can find out more about his project at:
http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/sdl/t127230762583
* Paul Hunkin is working on an official port of SDL 1.3 to the Android. I will be mentoring him and testing his code on my development Google Ion. You can find out more about his project at:
http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/sdl/t127230762779
* Sunny Sachanandani is working on integrating X11 XRender support into SDL 1.3, with support for hardware accelerated blending and more.
I will be mentoring him and testing his code on a variety of Linux distributions. You can find out more about his project at:
http://socghop.appspot.com/gsoc/student_project/show/google/gsoc2010/sdl/t127230762857
Introducing the Mentors:
* Andreas Schiffler is an architect/dev for a commercial SDL based windows+linux application with shaped-window support. He is volunteering as a mentor this year to help Eli with his project.
* Ryan Gordon is a long time friend and SDL developer, and is currently rewriting the SDL multi-mouse support. He will be mentoring Jim on his touch input project this year.
* I am the original author of SDL and founder of Galaxy Gameworks LLC, a small company devoted to commercial development and support of
SDL 1.3 and beyond. I am looking forward to mentoring Daniel, Paul, and Sunny.
Welcome! ![]()
–
-Sam Lantinga, Founder and President, Galaxy Gameworks LLC