Numbers Being Printed In Application (SDL)



  • *Firstly i should point out the fact that currently i am not rendering or drawing any text to the screen! *

    So in my basic SDL application, literally right now all i have is a few basic functions and a window appearing, i have this rather strange issue.
    I think it is best explained with an image of the issue;
    !http://i50.tinypic.com/seulcm.png(Issue)!

    I am literally quite puzzled as to what this actually might be. I mean all i have is a basic, bare window up and running. Nothing else. The only QT thing that appears is "qtcreator_process_stub.exe".
    My SDL Window is OpenGL enabled as i plan on using SDL as the backend for basic input and the like, and openGL for rendering.

    Any ideas on why this is happening?
    *I also have a slightly off topic seconded question, as to enquiring about qtcreator_process_stub.exe, what does that actually do? And is their a way of stopping that appearing?



  • I just had this issue with that qtcreator_process_stub.exe. First, make sure your profile is set up for a windows application, and not console.

    i.e., in your .pro file:
    CONFIG += windows
    CONFIG -= console

    Second, the window will appear when you start your program from QT Creator anyway. But when you start it by clicking on it in windows, the window will not appear, and so it won't be an issue for your program as it is distributed.

    As to the SDL problem, no idea. I can't even get a test program to compile, and I don't need it yet, so I really have no idea. I think i would try clearing the screen though, it must just be an artifact left over from initialization.



  • ok, I got the test to compile, no funny numbers on the screen. what compiler are you using? For mingw, if you get the "SDL-devel-1.2.15-mingw32.tar.gz" file from the SDL website, then set the SDL_DIR below to match where you put it, then:

    @TEMPLATE = app

    CONFIG += windows
    CONFIG -= console
    CONFIG -= app_bundle
    CONFIG -= qt

    SOURCES += SDL_TEST.cpp

    SDL_DIR = C:/Users/Malcolm/comp_stuff/sdl_mingw/SDL-1.2.15

    LIBS += -L$${SDL_DIR}/lib -lmingw32 -lSDLmain -lSDL

    INCLUDEPATH += $${SDL_DIR}/include/SDL
    DEPENDPATH += $${SDL_DIR}/include/SDL

    @

    should compile:

    @/*
    *SDL_TEST.cpp. do not use this file under any circumstances. it will probably blow up
    *your computer.

    */

    #include <cstdio>
    #include <Windows.h>
    #include <SDL.h>
    #include <gl/GL.h>
    #include <gl/GLU.h>

    using namespace std;

    int main(int argc, char **argv)
    {
    SDL_Surface *screen;

     /* Initialize defaults, Video and Audio */
    if((SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)==-1)) { 
        printf("Could not initialize SDL: %s.\n", SDL_GetError());
        exit(-1);
    }
    

    SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 0 );
    screen = SDL_SetVideoMode(1920, 1080, 32, SDL_HWSURFACE | /SDL_FULLSCREEN |/ SDL_OPENGL /| SDL_DOUBLEBUF/);

    SDL_Delay(1000);

    SDL_Quit();
    

    return 0;
    }

    @

    anyhow that worked for me. If you're not using mingw, I would think it shouldn't be too tough. btw, mingw and directx FTW.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.