Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8214319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:25:18+00:00 2026-06-07T11:25:18+00:00

I started making this super simple game engine with SDL and OpenGL on windows.

  • 0

I started making this super simple game engine with SDL and OpenGL on windows. The Engine is in a static lib and the so far all it does is display a blue window, with all the ground work for an engine.

It ran fine on Windows but then I ported it to Linux and nothing. The program runs fine and is shown in the system monitor but no window is appearing. I installed a couple of mesa and gl libs to check that wasn’t it. Now it wont run and says process terminated with status -1.

This is the initialization code in the engine. Please ask for anything else.

#include "Scales.h"
#include "SDL/SDL.h"
#include "gl.h"
#include "glu.h"

Engine *scalesEngine;

bool OnInit(int WindowHeight, int WindowWidth){

    SDL_Surface* Surf_Display;

    if(SDL_Init(SDL_INIT_EVERYTHING) < 0) {
        return false;
   }
    SDL_GL_SetAttribute(SDL_GL_RED_SIZE,        8);
    SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE,      8);
    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE,       8);
    SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE,      8);

    SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE,      16);
    SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE,        32);

    SDL_GL_SetAttribute(SDL_GL_ACCUM_RED_SIZE,    8);
    SDL_GL_SetAttribute(SDL_GL_ACCUM_GREEN_SIZE,    8);
    SDL_GL_SetAttribute(SDL_GL_ACCUM_BLUE_SIZE,    8);
    SDL_GL_SetAttribute(SDL_GL_ACCUM_ALPHA_SIZE,    8);

    SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS,  1);
    SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES,  2);

   if((Surf_Display = SDL_SetVideoMode(WindowWidth, WindowHeight, 32, SDL_HWSURFACE | SDL_GL_DOUBLEBUFFER | SDL_OPENGL)) = NULL){
        return false;
   }

   glClearColor(0.422f,0.576f,1.0f,1.0f);
   glClearDepth(1.0f);

   glViewport(0, 0, WindowWidth, WindowHeight);

   glMatrixMode(GL_PROJECTION);
   glLoadIdentity();

   glOrtho(0, WindowWidth, WindowHeight, 0, 1, -1);

   glMatrixMode(GL_MODELVIEW);

   glEnable(GL_TEXTURE_2D);

   glLoadIdentity();

   game_Init();

   return true;
}

int main(int argc, char* argv[]){

    scalesEngine = new Engine;

    game_preload();

    if(OnInit(scalesEngine->WindowHeight(), scalesEngine->WindowWidth()) == false){
        return -1;
    }

    SDL_Event Event;

    //Main Game Loop
    while(scalesEngine->Running){

        while(SDL_PollEvent(&Event)){
            scalesEngine->OnEvent(&Event);
        }


        scalesEngine->Update();
        scalesEngine->Render();
    }

    scalesEngine->OnCleanUp();
    delete scalesEngine;

    return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T11:25:21+00:00Added an answer on June 7, 2026 at 11:25 am

    If you do not get a window, I would suspect that you are not getting your hardware context. Try using SDL_SWSURFACE instead of SDL_HWSURFACE.

    SDL_SetVideoMode(... SDL_SWSURFACE ...
    

    I’ve seen this happen when developing in a VM, though I’m sure there are other reasons.

    edit:

    As noted in the comments, both of these surface flags may be superfluous along with SDL_OPENGL anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I started making this simple google chrome extension in javascript. And in the beginning
Hi. I've got a small game using directX10 and C++. However, I started making
Started with this question: OpenID. How do you logout OK. So OpenID does not
Weirdly, I've never come across this issue before, but I've just started making a
I started making a 3d game. then I stopped for a some time and
I just started making this .php file and i cant seem to figure out
I recently started making web-based apps with JQTouch. In this app, when a button
I'm making a simple Android game written in Java. I have my activity... public
I started making a game, I have a global class that reads in a
rails newbie here. I've started making a value based to-do list. So far I've

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.