Jump to content
  • Advertisement
Sign in to follow this  
swinchen

Final no hardware acceleration post!

This topic is 4838 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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:
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

Share this post


Link to post
Share on other sites
Advertisement
Wow, congrats.... that's been awhile in coming. You may want to delete your cookies, clear your cache, and restart your browser.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites



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;
}

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
It's possible you guys are trying to post too much code. Try to post minimal examples where practical.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!