When I trying to using SDL with opengl on
Linux(UBuntu 8.04) I got a error message.
“No input method could be opened”(SDL_SetVideoMode(m_iScreenWidth,
m_iScreenHeight, 0, flags))
The machine I used is
Mother board : AMD LX 800
Graphics card :Nvidia FX 5200
CPU:Intel:500 MHZ… lol
I am wandering to know what the problem is?
Is my machine old enough to say goodby?
Because it’s running fine on my new machine.(GF8500GT)
thanks for any advice
below is my code segament
void GameApp::InitializeSDL(void)
{
/* Information about the current video settings. /
const SDL_VideoInfo info = NULL;
/* Color depth in bits of our window. /
int bpp = 0;
/ Flags we will pass into SDL_SetVideoMode. /
int flags = 0;
SDL_Surface drawContext;
/* First, initialize SDL’s video subsystem. /
if(SDL_WasInit(SDL_INIT_VIDEO)&SDL_INIT_VIDEO)
{
m_bWasInitSDL = true;
}
else
if( SDL_Init( SDL_INIT_VIDEO) < 0 )
{
/ Failed, exit. */
fprintf( stderr, “Video initialization failed: %s\n”,
SDL_GetError( ) );
quit_SDL( 1 );
}
// Create a double-buffered draw context
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
info = SDL_GetVideoInfo( );
flags = SDL_OPENGL|SDL_HWSURFACE;//|SDL_FULLSCREEN;
if( info->current_w<m_iScreenWidth || info->current_h< m_iScreenHeight )
{
ErrorMsg(CharToWchar(“wanted resolution is bigger than screen
resolution”),L"Error");
m_iScreenHeight = info->current_h;
m_iScreenWidth = info->current_w;
}
drawContext = SDL_SetVideoMode(m_iScreenWidth, m_iScreenHeight, 0,
flags);
/* Let’s get some video information. */
bpp = info->vfmt->BitsPerPixel;
if( !info )
{
/* This should probably never happen. /
fprintf( stderr, “Video query failed: %s\n”,
SDL_GetError( ) );
quit_SDL( 1 );
}
char l_strForError = SDL_GetError();
if(strlen(l_strForError))
{
ErrorMsg(CharToWchar(l_strForError),L"Error");
}
}