• 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

131 Neutral

About ak09

  • Rank
  1. As an example, the SendMessage(hWnd, CB_GETCURSEL, 0, 0) function returns the selected index of a combo box. If my purpose is to read this index multiple times, I should call this function multiple times. Or don't I? Instead, is there an address where these kind of stuff are stored so I can and use it for making things easier?
  2. Hi, mhagain, thanks for the reply. Yeah, my hardware can't deal with that you mentioned. For the moment I'm wondering how good or bad is my current approach of copying a texture binded by some FBO into another binded by another FBO. The method consists in clearing the destination texture and drawing the first one to the second, so I can make the copy even if dealing with different sized textures.
  3. Yeah, it seems that I can't. FBO is not a buffer object.
  4. I tried every reasonable combination. Maybe it's important to say that I'm trying to copy an FBO to another (because I don't know if this function can deal with FBO's).  
  5. From the specification, void *glCopyBufferSubData(enum readtarget, enum writetarget, intptr readoffset, intptr writeoffset, sizeiptr size);               glCopyBufferSubData copies part of the data store attached to readtarget to the             data store attached to writetarget. The number of basic machine units indicated by size             is copied from the source, at offset readoffset to the destination at writeoffset,             also in basic machine units. It's not very clear, however, what's the meaning if readoffset, writeoffset and size, and how should them be used.           glBindFramebuffer(GL_COPY_READ_BUFFER, fboSrc);         glBindFramebuffer(GL_COPY_WRITE_BUFFER, fboDst);         glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, ?, ?, ?);     Any clue?         
  6. Thanks for the replies.   That's exactly what I want: be able to see my layers from different perspectives and choose one among them with a nice interface. However, I couldn't make it work yet. Tried both approaches, from Bob and Olof, but stills nothing. I don't know if I'm doing the calculations ok. Let me try to explain exactly how it's being done so far: The layer l1 is drawn over the layer l2. Every layer have it's own attributes, i.e, xPosition, yPosition, width, height, and angle, so I must (I guess) apply the properly transformations in the modelview matrix before each draw.   As posted before, that's my perspective function, called before anything:   void setPerspective(int w, int h) {     glViewport(0, 0, w, h);     glMatrixMode(GL_PROJECTION);     glLoadIdentity();     // gluOrtho2D(0, w, h, 0); (the old guy)     gluPerspective(60.0, (GLfloat) w/(GLfloat) h, 0.001, 5000.0);     glMatrixMode(GL_MODELVIEW);     glLoadIdentity();     ... (transformations suggested by you) }       And that's the mess with which my layer is drawn, working perfectly with ortho2D:                 glLoadIdentity();             setPerspective(dst->width, dst->height);                // Dest transformations             glTranslatef(dst->cx, dst->cy, 0);  // cx = width/2   cy = height/2             glRotatef(-dst->angle, 0, 0, 1);             glTranslatef(-dst->cx, -dst->cy, 0);             glTranslatef(-dst->x, -dst->y, 0.0f);                // Source transformations             glTranslatef(src->x, src->y, 0.0f);             glTranslatef(src->cx, src->cy, 0);             glRotatef(src->angle, 0, 0, 1);             glTranslatef(-src->cx, -src->cy, 0);             glBindTexture(GL_TEXTURE_2D, src->texID;             glBegin(GL_QUADS);             glTexCoord2f(0.0f, 1.0f);  glVertex2i(0,0);                 glTexCoord2f(1.0f, 1.0f);  glVertex2i(src->width,0);               glTexCoord2f(1.0f, 0.0f);  glVertex2i(src->width,src->height);               glTexCoord2f(0.0f, 0.0f);  glVertex2i(0,src->height);             glEnd();             glBindTexture(GL_TEXTURE_2D, 0);      
  7. Sorry, but this is a little vague to me. All I'm doing is making a perspective change before every texture draw — since they can have different sizes — with:   void setPerspective(int w, int h) {     glViewport(0, 0, w, h);     glMatrixMode(GL_PROJECTION);     glLoadIdentity();     gluOrtho2D(0, w, h, 0);     glMatrixMode(GL_MODELVIEW); }     By replacing my gluOrtho2D with gluPerspective, what changes shoud I make and where?
  8. I'm drawing 2D, on different layers, dealing with real coordinates [(0,0), (screenWidth, screenHeight)] instead of the standard [-1,1]. And everything is ok when using gluOrtho2D(0, w, h, 0). However, I want to be able to render those layers in a 3D space, so the user can merge in the scene. The problem is: with gluPerspective, all my coordinates are changed, and for the reason I'd have to change them all in my code, this is strictly unwanted. So, is there a (simple) way to solve my thing?  
  9. Solved! Instead of HTSIZE I return now HTBOTTOMRIGHT.
  10. I got it, but returning HTSIZE when mouse is over my area just makes it freeze. This is what I get:       case WM_NCHITTEST:         if (onArea(LOWORD(lParam), HIWORD(lParam))             return HTSIZE;         return DefWindowProc(hWnd, msg, wParam, lParam);  
  11. The rectangle I mentioned represents a layer on wich my stuff will be drawn. But I'm dealing with several layers. So, doesn't your suggestion implies in making HWND's of my layers?
  12. Ok, so I have a rectangle drawn on my screen (via OpenGL), and I want to make it resizable — just like the standard resize box of all windows. Is there a simple way, other than checking mannualy if mouse position is here or there and changing cursor again and again , to do it?
  13.  I found that a simple fragment shader for that would be something like:     uniform sampler2D Mtexture; void main() {     vec4 color = texture2D(Mtexture, gl_TexCoord[0].st);     gl_FragColor = vec4(1.0 - color.r, 1.0 - color.g, 1.0 - color.b, color.a); } And the OGL code:       glUseProgram(prog);     glBindFramebuffer(GL_FRAMEBUFFER, fbo);     glColor4f(1, 1, 1, 1);     glBindTexture(GL_TEXTURE_2D, tex);     glBegin(GL_QUADS);     glTexCoord2f(0.0f, 1.0f);  glVertex2i(0,0);         glTexCoord2f(1.0f, 1.0f);  glVertex2i(width,0);       glTexCoord2f(1.0f, 0.0f);  glVertex2i(width,height);       glTexCoord2f(0.0f, 0.0f);  glVertex2i(0,height);     glEnd();     glBindTexture(GL_TEXTURE_2D, 0);     glBindFramebuffer(GL_FRAMEBUFFER, 0);     glUseProgram(0); However, it's not giving me the expected results, and this is driving me crazy. Should I disable GL_BLEND before applying the filter? Case not, which function to use? Should I clear my texture before using a shader on it? <-- Never understood this
  14. Sorry, what do you mean?
  15.  The first image shows one circle overlapping another. They were drawn in a texture, with fbo, and blended with   glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,GL_ONE,GL_ONE_MINUS_SRC_ALPHA);   [attachment=15533:certo.PNG] The second one shows the same stuff, but one circle is on textureA, and the other one on textureB (both handled by a fbo). Each texture was drawn on the screen, calling glBindTexture(GL_TEXTURE_2D, textureA); ... glBindTexture(GL_TEXTURE_2D, textureB); ...   [attachment=15534:err.PNG] My question is: why the blending differs? How can I fix it?