Skip to content

Game Development

What can we say - we like games. And you can use Qt to write some. Questions? Ask here.
863 Topics 4.0k Posts
  • Cute3D Game Engine

    16
    0 Votes
    16 Posts
    7k Views
    R

    People,

    We release the Cute3D official logo on our facebook page. Follow us, soon more informations!!!

    https://www.facebook.com/sunlandstudios

    Best regards,
    Renato Dias Viana
    CTO, Sunland Studios

  • 0 Votes
    8 Posts
    5k Views
    C

    Thanks all for commenting here.

    agocs,
    Why we need multiple inheritance.?How will it solve my problems?

    sierdzio,
    That really was an useful information.

    jiangcaiyang,
    I tried it but no luck. Seems like Qt5.3.1 does not supports it.Not sure.

  • 0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • Qt5 crash (GLSL try to get uniforms)

    5
    0 Votes
    5 Posts
    2k Views
    F

    [quote author="Cmdr" date="1406816772"]Another thing that I noticed: AFAIK QWidgets without a parent are initally invisible. Depending on your platform it might be impossible to create an OpenGL context for an invisible window. So you might try to call temp.show() prior to context initialization.
    [/quote]

    It works on 4.8.6 without show, and this code works on ~10 PCs with different hardware(Intel, nVidia, AMD) no problems. But on Qt5 this code causes crash on all machines. Problem in Qt5 it seems.

  • QOpenGLTexture and QOpenGLFrameBufferObject

    4
    1 Votes
    4 Posts
    4k Views
    C

    No, the QImage won't help here. I suggest you use vanilla OpenGL functions on the texture id returned by QOpenGLFramebufferObject::texture() and don't use QOpenGLTexture for this purpose at all. This shouldn't be too difficult: use glActiveTexture to set the texture unit you want to bind the texture to, and then glBindTexture to bind it. I don't know which parameters QOpenGLFrameBufferObject sets on the texture, so you might need to disable mip mapping with glTexParameteri.

  • OSX and opengl profile > 2.1 on Qt 4.8

    2
    0 Votes
    2 Posts
    1k Views
    B

    Ok - I'll answer my own question.

    The answer is that QGL in Qt 4.8 does not support profiles above compatibility 2.1.

    To do so requires hacking the file qgl_mac.mm and adding NSOpenGLPFAOpenGLProfile and NSOpenGLProfileVersion3_2Core to the NSOpenGLPixelFormatAttributes structures used.

    Don't treat the following diff as a complete solution - it will break any old style OpenGL on mac:

    diff --git a/build/packages/qt-everywhere-opensource-src-4.8.6/src/opengl/qgl_mac.mm b/build/packages/qt-everywhere-opensource-src-4.8.6/src/opengl/qgl_mac.mm
    index 4ecf888..52b24ed 100644
    --- a/build/packages/qt-everywhere-opensource-src-4.8.6/src/opengl/qgl_mac.mm
    +++ b/build/packages/qt-everywhere-opensource-src-4.8.6/src/opengl/qgl_mac.mm
    @@ -148,7 +148,11 @@ QGLTemporaryContext::QGLTemporaryContext(bool, QWidget *)
    aglDestroyPixelFormat(fmt);
    #else
    QMacCocoaAutoReleasePool pool;

    NSOpenGLPixelFormatAttribute attribs[] = { 0 }; NSOpenGLPixelFormatAttribute attribs[] = { NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core, 0 };
    NSOpenGLPixelFormat *fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs];
    if (!fmt) {
    qWarning("QGLTemporaryContext: Cannot find any visuals");
    @@ -350,7 +354,7 @@ bool QGLContext::chooseContext(const QGLContext *shareContext)

    void *QGLContextPrivate::tryFormat(const QGLFormat &format)
    {

    static const int Max = 40;

    static const int Max = 42;
    #ifndef QT_MAC_USE_COCOA
    GLint attribs[Max], cnt = 0;
    bool device_is_pixmap = (paintDevice->devType() == QInternal::Pixmap);
    @@ -464,6 +468,10 @@ void *QGLContextPrivate::tryFormat(const QGLFormat &format)
    if (devType == QInternal::Pbuffer)
    attribs[cnt++] = NSOpenGLPFAPixelBuffer;

    attribs[cnt++] = NSOpenGLPFAOpenGLProfile;

    attribs[cnt++] = NSOpenGLProfileVersion3_2Core;

    attribs[cnt] = 0;
    Q_ASSERT(cnt < Max);
    return [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs];

  • 0 Votes
    2 Posts
    1k Views
    SGaistS

    Hi,

    I'm not sure whether it supports 3D Step files, but IIRC the assimp library can be used with Qt

    Hope it helps

  • 0 Votes
    5 Posts
    4k Views
    S

    it seems i can eg create a quickview in main, call setformat and then initializeopenglfunctions just fine..not sure why what i was doing wasn't working..i guess it was happening before it init'd or sth

  • What to use?

    6
    0 Votes
    6 Posts
    2k Views
    JKSHJ

    [quote author="Ferobles92" date="1403893158"]@mmcdon15
    I just started working on the SAME project, and I am using QWidgets. Qt 5.3 has the QWindow framework, which I understand as recommended if you are going to interface directly with OpenGL to render on a screen.

    To those of you who know Qt 5.3 better, is that a feasible approach? Would I still be able to drag objects drawn on the QWindow?[/quote]Hi, and welcome to the Qt Dev Net!

    If you want to write your own OpenGL rendering code, then yes QWindow is the best choice for displaying. Note that you will also need to implement low-level mouse handling for drag-and-drop support. See the "QWindow documentation":http://qt-project.org/doc/qt-5/qwindow.html and pay attention to functions like mousePressEvent().

    Still, I encourage you to read the links that qxoz posted to see if other solutions meet your needs. If you don't need to write custom OpenGL code, the others are easier than QWindow.

  • 0 Votes
    4 Posts
    2k Views
    P

    Bingo! It works! Thank you for your help!

  • Qt 5.3 to do android's app

    1
    0 Votes
    1 Posts
    980 Views
    No one has replied
  • QT for games

    4
    0 Votes
    4 Posts
    5k Views
    R

    Hi Jaysistar.

    See the post.

    "Cute3D":http://qt-project.org/forums/viewthread/42924/

  • OpenGL VBO

    7
    0 Votes
    7 Posts
    3k Views
    S

    ok but @&vector[0]@
    is an different address,
    mby
    @ &vector->at(0) @
    (or
    @&(*vector)[0] @
    seem to be the same)
    will work in openlgl I'll try that
    but i think I alrdy tried &vector-at(0) and It didn't work, we'll see

  • 0 Votes
    1 Posts
    797 Views
    No one has replied
  • How to make a Monopoly board with Qt

    14
    0 Votes
    14 Posts
    5k Views
    S

    You could instead use a QGraphicsView for the board and QGraphicsPixmapItems for the 'tokens'.

    It might take longer to implement though, depending on your learning curve.

  • Card game interface and functionality

    4
    0 Votes
    4 Posts
    5k Views
    F

    Hi Marcius,
    how has your progress been so far, and did you decide for QML?
    I would highly recommend using QML for the UI of your game, as it is better suited for mobile and a more rapid development approach than C++.
    If you do not have any performance-sensitive code, I would even try using JavaScript/QML for the game logic as well.

    Our games for example are purely based on QML & JavaScript with some of the more performance-sensitive tasks like path finding written in C++. You can have a look at the source code of them here: http://v-play.net/doc/vplay-examples/

    Cheers,
    Chris

  • 0 Votes
    2 Posts
    897 Views
    SGaistS

    Hi,

    Please don't post the same question in multiple sub-forum, one is enough.

    "Duplicate":http://qt-project.org/forums/viewthread/41548/

    Closing this one

  • OpenGL ES 2.0 & the Depth Buffer/Texture

    8
    0 Votes
    8 Posts
    19k Views
    S

    I have a question.
    In case with m_hasDepthTextureExtension == true.
    Do I need attach render buffer?

    Because in another case glCheckFramebufferStatus may return error incomplete framebuffer, right?

  • Rotating 2 objects Qt and openGL.

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied