Skip to content

Game Development

What can we say - we like games. And you can use Qt to write some. Questions? Ask here.
875 Topics 4.1k Posts
  • "Invalid operation" error in resizeGL after window closed

    Unsolved
    3
    0 Votes
    3 Posts
    865 Views
    8Observer88
    I reported the bug: https://bugreports.qt.io/browse/QTBUG-111016
  • Musical MIDI game - is Qt right for my project?

    Unsolved
    9
    1 Votes
    9 Posts
    2k Views
    BrunodB
    @KH-219Design said in Musical MIDI game - is Qt right for my project?: User base of precisely 2. Sounds pretty excellent :) ^^ indeed it does I have next to zero free time these days. However, if your work is on github or gitlab (or similar), please share a link. I would definitely check it out and look in on it every couple weeks, and maybe share thoughts if anything strikes me. When I have something to share, I will :-) Here is another MIDI project that I found useful recently, and it sounds like it might belong in your bookmarks, too: https://github.com/markc/midicomp SWEET! I have plenty of stuff to learn from now. That should keep me busy for the foreseeable future. Thx
  • How to use the Box2D's b2Draw class in PyQt6 with OpenGL3? DrawSegment is not called

    Solved
    11
    0 Votes
    11 Posts
    1k Views
    8Observer88
    Added restart button: [image: fb996c81-97b7-4638-bf04-ecbc7e6a32c7.gif] Source code: https://github.com/8Observer8/edit-gravity-debug-drawer-opengl1-pyqt6
  • 0 Votes
    2 Posts
    1k Views
    D
    @nishithaa I have tried to do this for years to make a VR video player using Qt and I'm finally close to achieving it but without gstreamer. I don't know if gstreamer is a requirement to you but I use libvlc 4, based on this example : https://github.com/videolan/vlc/tree/master/doc/libvlc/QtGL . It compiles and runs well but I don't want to use QOpenGLWidget (I use QWindows with manually-managed QOpenGLContexts) and somehow I can't make it to work in this setup.
  • Pause and Resume a QTimer

    qtimer pause resume timer
    8
    1 Votes
    8 Posts
    3k Views
    B
    @Chris-Kawa You know what I just realized... the QTimer::singleShot method doesn't even work because you won't know the remaining time if you pause again during the single shot.
  • QScreenRayCaster depth of ray adjustable? appears limited to < 50,000

    Unsolved
    2
    0 Votes
    2 Posts
    521 Views
    uaniU
    appears to be a single precision floating point issue, as used by Qt3D internally
  • QScreenRayCaster does not hit triangles around size 1.0f and smaller

    Unsolved
    4
    0 Votes
    4 Posts
    870 Views
    uaniU
    appears to have been due to single precision floating point used by Qt3D internally.
  • QCameraLens fieldOfView is ... geometrically in Qt :

    Solved
    1
    0 Votes
    1 Posts
    370 Views
    No one has replied
  • Bad performance cube example

    Unsolved
    4
    0 Votes
    4 Posts
    967 Views
    P
    Ok, so I've added v-sync by using QOpenGLWindow and its frameSwapped signal. Some good news and some bad. V-sync solved one issue. At first with v-sync was still measuring many delays, but I found that some of those were actually measurement errors. QDateTime::currentMSecsSinceEpoch() is not accurate enough, I'm using QElapsedTimer now. Also the code I used to test somehow interfered with the measurement. When I just printed qDebug() << elapsedTimer.elapsed() - lastUpdateRotation; without branch, and did the analysis in excel, I found that almost all frames took 16-17 ms, so exactly 60fps :) It didn't solve the frame skips on the RTX 2060. I'm getting none on the surface's iGPU (ok, I got a few above 20, but all of these were still below 30ms), but for some reason the desktop with beefy GPU still skips 0.7% of frames. And these are above 40ms, so really noticeable, max is 100ms. I'm measuring on the frameSwapped signal now, so I can't blame the qt event loop for doing something between frameSwapped and paint. It might be something between the driver and GPU, but I'm still somewhat lost on this part.
  • QScreenRayCaster->addLayer(...) has no effect

    Unsolved
    1
    0 Votes
    1 Posts
    430 Views
    No one has replied
  • QtWheelEvent* in signal from handler: should I delete it?

    Solved
    2
    0 Votes
    2 Posts
    521 Views
    jsulmJ
    @uani No, you do not have to delete the events - those are handled by Qt.
  • QScreenRayCaster trigger y parameter needs to be "inverted": by design or bug?

    Unsolved
    3
    0 Votes
    3 Posts
    613 Views
    uaniU
    @e2002e yes, this is how the mouse pointer y coordinate is delivered but when I use it to screenraycast it hits on the opposite vertical side of the entity. I subtract the mouse pointer y from the viewport height now to have a QScreenRayCast hit as expected.
  • QDiffuseSpecularMaterial bug: OpenGL fragment shader not supported

    Unsolved
    5
    0 Votes
    5 Posts
    927 Views
    uaniU
    oh, i'm sorry, i was referring to https://forum.qt.io/topic/140839/qtexturematerial-error-unable-to-find-suitable-texture-unit-for-diffusetexture-ogl-sampler-diffusetexture-wasn-t-set-on-material-rendering-might-not-work-as-expected-dx by "texture issue" where I posted about an issue almost too embarassing to mention it again. This one here I would contribute more research to but i already used more time than i envisioned for my project and i desired to prorgress that.
  • 0 Votes
    2 Posts
    1k Views
    uaniU
    my bad: ((Qt3DExtras::QTextureMaterial)material).setTexture(t); should have been ((Qt3DExtras::QTextureMaterial*)material)->setTexture(t); :facepalm: i'm sorry for bothering you. However the "status changed" signal i'm still not receiving.
  • How could I make a C++ compiler for a game engine like how QT does it?

    Unsolved
    4
    0 Votes
    4 Posts
    835 Views
    Chris KawaC
    I mean MSVC as the compiler Ok, so you asked why you can't use it. Well, you can.
  • Troubles with Arduino to Qt.

    Unsolved
    2
    0 Votes
    2 Posts
    505 Views
    SGaistS
    Hi and welcome to devnet, One way could be to use the serial port of your Arduino to communicate with the computer.
  • how to resize a text automatically to fit the qpushbutton ?

    Solved
    5
    0 Votes
    5 Posts
    2k Views
    M
    @JoeCFD thank you Joe, I found the solution on github https://github.com/jonaias/DynamicFontSizeWidgets
  • [QTest][GUI] Is possible to show and set window's background?

    Unsolved
    2
    0 Votes
    2 Posts
    494 Views
    SGaistS
    Hi, Did you try to use qWaitForWindowExposed ?
  • Do we still need to call XFlush in Qt 6?

    Unsolved
    4
    0 Votes
    4 Posts
    839 Views
    J.HilkJ
    @mhn2 afaik Q_WS_X11 was a Qt4 define, and was replaced by the much better Qt Platform Abstraction system. https://doc.qt.io/qt-6/qpa.html the x11 support still exists, you find that now here: https://doc.qt.io/qt-6/linux.html
  • How to use the Box2D's b2Draw class in Qt6 with OpenGL3? DrawSegment is not called

    Solved
    2
    0 Votes
    2 Posts
    638 Views
    8Observer88
    I should use DrawPolygon to draw segments of colliders when I use boxes to draw borders around game objects. DrawSegment() will be called when an instance of b2EdgeShape is created: b2EdgeShape edgeShape; edgeShape.SetOneSided(b2Vec2(0.f, 0.f), b2Vec2(1.f, 0.f), b2Vec2(2.f, 0.f), b2Vec2(3.f, 0.f)); m_pEdgeBody = m_pWorld->CreateBody(&bdef); m_pEdgeBody->CreateFixture(&edgeShape, 2.f);