Skip to content

Game Development

What can we say - we like games. And you can use Qt to write some. Questions? Ask here.
862 Topics 4.0k Posts
  • Unessesary repaint how to avoid

    9
    0 Votes
    9 Posts
    4k Views
    M

    Please edit your posts (using the edit link on the right-hand side of the post) instead of creating a new entry for corrections. I've merged the two entries into one.

    Thanks!

  • Asteroids Game, need help moving ship

    6
    0 Votes
    6 Posts
    4k Views
    M

    Sounds like someone has skipped trigonometry lessons in school :)

    I guess what you want is to form a forward vector which is something like f = cos(angle)x + sin(angle)y depending on what you choose angle=0 to represent..

    Then you form a velocity vector of s*f (s=scalar speed) and use that to move your ship's position.

    M
  • 0 Votes
    4 Posts
    2k Views
    M

    Number of (active) collision shapes & their complexity is what build the CPU strain of the process, obviously - so, use as simple collision shapes as possible (you can use combinations to represent more complex objects) and only include the shapes you need in the calculations; if some objects are far away from the "action", just remove them from the list of active shapes and save some calculation power. I would suggest asking this on the Bullet Forums as they are the right people to discuss this with. My experience with it is limited to a single "mobile app":http://777-team.org/~matti/software/ToyBlocks/ where I used a multithreaded approach to do the physics calculations in a separate thread, using some 8-50 box collision shapes at once. I have no experience in PhysX nor have no idea how much complexity can a gaming PC handle, for instance.

    M
  • Moving Objects in a Game

    3
    0 Votes
    3 Posts
    6k Views
    I

    Hi Gmaro, thank you for your help. However, I've been looking through the QML examples for a very long time.. Most of them have restricted X & Y axis movement, my river is very twisty and bendy, requires the objects to move in diagonals and in different angles. Is this possible with QML?

  • 0 Votes
    2 Posts
    2k Views
    I

    Texto original en español

    Me sucedia algo similar con:
    @image("../carpeta/archivo")@

    Lo solucione cuando coloque las imágenes en una carpeta directamente en donde se aloja el main del programa.
    Cuando use archivos *.js era necesario colocar "../carpeta/archivo", pero al colocarlo en archivos *.qml solo coloque "/carpeta/archivo".

    Traducción

    Something similar to:
    @ image("../ folder/file") @

    when you place the images in a folder directly in that it hosts the * main* program. When you use *.js files needed to put "../ folder/file", but to put it in files only *.qml put "/ folder/file".

  • Open GL ES2.0 - glDrawelements()

    2
    0 Votes
    2 Posts
    4k Views
    M

    @m_sampleProgram.enableAttributeArray(vertexAttr);
    m_sampleProgram.setAttributeBuffer(vertexAttr, GL_FLOAT, 0 * sizeof(GLfloat), 3, 5 * sizeof(GLfloat));
    m_sampleProgram.enableAttributeArray(texAttr);
    m_sampleProgram.setAttributeBuffer(texAttr, GL_FLOAT, 3 * sizeof(GLfloat), 2, 6 * sizeof(GLfloat));
    m_sampleProgram.enableAttributeArray(normalAttr);
    m_sampleProgram.setAttributeBuffer(normalAttr, GL_FLOAT, 5 * sizeof(GLfloat), 3, 5 * sizeof(GLfloat));@

    Looks like vertex strides are wrong.

  • Resizing QGL Widget

    3
    0 Votes
    3 Posts
    4k Views
    M

    You need also to change projection matrix.

  • Mysterious Bar that appears with QGraphicsView

    4
    0 Votes
    4 Posts
    2k Views
    Y

    This might solve it (all essentially the same post - one solution for QML apps and another for straightforward Qt/C++):

    http://qt-project.org/wiki/How_to_Remove_Toolbar_from_MeeGo_Harmattan_Application
    http://qt-project.org/forums/viewthread/11746
    http://qt-project.org/forums/viewreply/71208/

  • 0 Votes
    5 Posts
    3k Views
    K

    Hi koahnig

    I tried that, but it results a lot of other errors, basically pertaining to undefined OpenGL/QtGL things. Inheriting QGLWidget is kind of necessary.
    Thanks for helping anyways.

  • 0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    2 Posts
    1k Views
    K

    welcome to devnet

    Please use "code wrapping":http://qt-project.org/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01 for your code sections nect time. I have introduced them for you.

  • 0 Votes
    4 Posts
    9k Views
    K

    Hi

    I inserted the two lines (with both GL_GLEXT_PROTOTYPES and GL_GLEXT_LEGACY i.e. first one then the other). The code is compiling fine but its crashing with an assertion in the qglfunctions.h file.

    Exact debugger output:
    bq. Initializing shaders...
    Initializing geometries...
    ASSERT: "QGLFunctions::isInitialized(d_ptr)" in file ........\Desktop\Qt\4.8.0\mingw\include/QtOpenGL/qglfunctions.h, line 719
    Invalid parameter passed to C runtime function.
    Invalid parameter passed to C runtime function.

    I also tried directly including glext.h, but the same assertion persists.

  • Using sounds in Qt Linux?

    5
    0 Votes
    5 Posts
    3k Views
    B

    So, any progress on this yet?

  • Position touch event in QWidget

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Qt and OpenGL problems

    2
    0 Votes
    2 Posts
    4k Views
    M

    I've had problems with glew myself and was able to work around it by making sure glew.h (actually gltools.h in my case) was before any qt opengl header files in my source. With multiple header files, this was surprisingly difficult, but it finally worked after some re-arranging.

    morris

  • Pbo works with ATI but not nvidia

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Error: 'QGLBuffer::IndexBuffer' is not a type

    2
    0 Votes
    2 Posts
    2k Views
    Z

    Try adding:

    @
    #include <QGLBuffer>
    @

    at the top of your file.

  • 0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    5 Posts
    3k Views
    A

    okay.. got it.. thanks...

  • Bullet physics engine in qt

    4
    0 Votes
    4 Posts
    5k Views
    A

    thanks shahid.pk.. it was helpful.. :)