Quote: This (read-only) structure is returned by SDL_GetVideoInfo. It contains information on either the 'best' available mode (if called before SDL_SetVideoMode) or the current video mode.this is the result of my program. (Before SDL_SetVideoMode) Is it possible to create hardware surfaces? N Is there a window manager available? Y Are hardware to hardware blits accelerated? N Are hardware to hardware colorkey blits accelerated? N Are hardware to hardware alpha blits accelerated? N Are software to hardware blits accelerated? N Are software to hardware colorkey blits accelerated? N Are software to hardware alpha blits accelerated? N Are color fills accelerated? N Total amount of video memory in Kilobytes: 0 (After SDL_SetVideoMode) Is it possible to create hardware surfaces? N Is there a window manager available? Y Are hardware to hardware blits accelerated? N Are hardware to hardware colorkey blits accelerated? N Are hardware to hardware alpha blits accelerated? N Are software to hardware blits accelerated? N Are software to hardware colorkey blits accelerated? N Are software to hardware alpha blits accelerated? N Are color fills accelerated? N Total amount of video memory in Kilobytes: 0
Final no hardware acceleration post!
Ok, I am going to type this up from scratch instead of copying from a text file.
I am querying the video information using SDL_GetVideoInfo to see what is supported, and I am a little confused by the results. It says basically that I have no hardware acceleration and no video memory! I tested both before and after calling SDL_SetVideoMode because according to he documentation:
Wow, congrats.... that's been awhile in coming. You may want to delete your cookies, clear your cache, and restart your browser.
Ok, I did that. I think it has something to do with the source code I was trying to post. After I posted the top two messages, I tried using a [ source ] [ /source ] block and pasting my code... no good. Is it possible that the code could have messed up the post?
Sam
Sam
Who knows. A good programmer will approach the problem methodically, posting part of the code to see if it's the problem, repeating with more code, eventually working up to a full post or finding the source of the difficulty...
I'm interested in what you're passing to SDL_SetVideoMode.
I'm interested in what you're passing to SDL_SetVideoMode.
const int VIDEO_HEIGHT = 768; const int VIDEO_WIDTH = 1024; const int BPP = 32; SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER); print_vid_info(); SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); Uint32 video_flags; video_flags = SDL_OPENGL; video_flags |= SDL_HWPALETTE; video_flags |= SDL_HWSURFACE; video_flags |= SDL_HWACCEL; video_flags |= SDL_FULLSCREEN; SDL_Surface *sdl_win = SDL_SetVideoMode(VIDEO_WIDTH, VIDEO_HEIGHT, BPP, video_flags); print_vid_info();
And the code for print_vid_info()
void print_vid_info(void){ const SDL_VideoInfo *vid_info = SDL_GetVideoInfo(); printf("Is it possible to create hardware surfaces? "); vid_info->hw_available == 1 ? printf("Y\n") : printf("N\n"); printf("Is there a window manager available? "); vid_info->wm_available == 1 ? printf("Y\n") : printf("N\n"); printf("Are hardware to hardware blits accelerated? "); vid_info->blit_hw == 1 ? printf("Y\n") : printf("N\n"); printf("Are hardware to hardware colorkey blits accelerated? "); vid_info->blit_hw_CC == 1? printf("Y\n") : printf("N\n"); printf("Are hardware to hardware alpha blits accelerated? "); vid_info->blit_hw_A == 1? printf("Y\n") : printf("N\n"); printf("Are software to hardware blits accelerated? "); vid_info->blit_sw == 1 ? printf("Y\n") : printf("N\n"); printf("Are software to hardware colorkey blits accelerated? "); vid_info->blit_sw_CC == 1? printf("Y\n") : printf("N\n"); printf("Are software to hardware alpha blits accelerated? "); vid_info->blit_sw_A == 1? printf("Y\n") : printf("N\n"); printf("Are color fills accelerated? "); vid_info->blit_fill == 1? printf("Y\n") : printf("N\n"); printf("Total amount of video memory in Kilobytes: %u\n", vid_info->video_mem); return;}
Don't worry about it: if you're using OpenGL then those values are probably invalid anyway. I believe they refer to the blit performance, not the OpenGL performance. Hardware acceleration of 2D blits is a different beast altogether. Try rendering a few triangles with vsync turned off. If you've got any OpenGL acceleration you're likely to see a few hundred frames per second, and if you haven't, it's likely to be less than 50fps or so.
Also, try removing those SDL_HWPALETTE, SDL_HWSURFACE, and SDL_HWACCEL lines: you probably don't need them and they may be what is confusing the system.
Also, try removing those SDL_HWPALETTE, SDL_HWSURFACE, and SDL_HWACCEL lines: you probably don't need them and they may be what is confusing the system.
And if you're like me and wish to use SDL_Surfaces and such _with_ OpenGL-support then have a look at glSDL ! I got a nice speedup with this even though it's a rather messy hack :)
swinchen, how did you solve your problem with the source /source bugging. I'm having this problem at the moment and i can't fix it. Yes i cleared all my cache.
It's possible you guys are trying to post too much code. Try to post minimal examples where practical.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement