• 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.


  • Content count

  • Joined

  • Last visited

Community Reputation

122 Neutral

About Grudzio

  • Rank
  1. I think that the texture does not show up because You set texture coordinates for the GL_TEXTURE1, while the shader uses tex coords for GL_TEXTURE0.
  2. 1.The computed angle is in radians. I am sorry but I dont know what is expected by SDL_rotozoom. float dx = x - centerX; float dy = y - centerY; float angle = atan2(dy,dx); 2. I assume that object moves with velocity v and (px,py) is objects current location. new_x = px + v*cos(angle); new_y = py + v*sin(angle); It will work if your objects starting position is in the center of the screen.
  3. I see two possible problems. 1. Surface format. before sending surface->pixels to gluBuildMipmaps convert surface to 32 bpp format. 2. gluBuildMipmaps. This function has been made in the times when OpenGL supported only power of two textures. Your text texture may or may not have sizes that are powers of two. (The chances that it will, are very low). gluBuildMipmaps scales the image data if it is non-power of two and it corrupts your text. So don't use it. glTexImage2D should be enough. But still there is a problem of your text textures beeing non power of two. It will work if your card supports NPOT textures. But probably it is better to use texture rectangles (GL_TEXTURE_RECTANGLE_ARB) since more cards support them than NPOT textures.
  4. Let w and h be the width and height of the base image (image that contains the nonrectangular one). Calculate OpenGL texture coordinates in the following way (new_tx, new_ty) = (tx/w, (h-ty)/h) (tx,ty) are the coordinates of the image and (new_tx,new_ty) are coordinates that will be passed to glTexCoord.
  5. When OpenGL is used with SDL, the bpp parameter in SDL_SetVideoMode is ignored. The color sizes passed to SDL_GL_SetAttribute are only hints, so you may or may not get what you asked for. From my experience it only depends on desktop color mode. If it is set to 32bpp you will get 8 bits per color, if set to 16bpp you will get 5 bits per color. In theory calling SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE, your_bpp_value) should set the bits per pixel for OpenGL context. But, at least for me, it is not working.
  6. As described here some events like resizing window or changing to fullscreen may destroy the OpenGL context. All OpenGL states and resources (including textures) are lost. So you have to recreate all OpenGL textures.
  7. Quote: If I did store them as one texture I could just render one surface that contains all printable characters, and then "chop" the texture into display lists using the glyph metrics correct? Exactly. Also you call glBindTexture only once - for whole printed string and not for each char. I know very little about OpenGL texture management but I believe that it is better to use one big texture then lots of small ones.
  8. In print_glstr function set w to font->glyphs[i].advance and h to font->height, since maxx and maxy don't give glyph width and height. Another possibility is the call to TTF_RenderGlyph_Blended. Replace it with TTF_RenderGlyph_Solid. I would also suggest putting all glyphs in one big OpenGL texture. Something like in NeHe tutorial #17 (textured fonts).
  9. If you look into the Nehe tutorial 13 (Linux/SDL) you will find the following line fontInfo = XLoadQueryFont( dpy, "-adobe-helvetica-medium-r-normal--18-*-*-*-p-*-iso8859-1" ); This string "-adobe-helvetica-medium-r-normal--18-*-*-*-p-*-iso8859-1" sets all font properties. To change its size replace 18 with another number. If you want to change font type replace "helvetica" with the name of the font you want to use. To make font bold replace "medium" with "bold" and to make it italic replace "r" with "o". To get more information about X font description check http://www.sensi.org/~alec/locale/other/xlfd.html Once the font is created you can't change its properties.
  10. I would do something like this. Lets assume that enemy notices player who is at position (x0,y0). So rotate enemy and move it to (x0,y0). When it reaches (x0,y0) player is at new location (x1,y1). So turn enemy and make it move to (x1,y1) and so on until enemy catches the player. This is the simplest way I can think of. This can be improved by checking player's position more often. Move enemy towards (x0,y0) and after some time (before enemy reaches x0,y0) check if player has moved if yes, then turn enemy and move it towards new position. If you want to have your enemies a bit smarter you can make them try to intercept the player (with assumption that player does not change its speed and direction). I hope it helps.
  11. Try rendering a simple textured quad. I think something is wrong with your drawing code. For example you set the same texture coordinate twice ( glTexCoord2f(1.0,0.0) ).
  12. A link to a 3D spline tutorial.