SDL_RenderDrawPoint not working

时间:2015-09-01 21:41:20

标签: sdl sdl-2

If i use this code:

                SDL_SetRenderDrawColor( renderer.get(), 0x00, 0x00, 0xFF, 0xFF );       
                SDL_RenderDrawLine( renderer.get(), 0, 480 / 2, 640, 480 / 2 );

                //Draw vertical line of yellow dots
                SDL_SetRenderDrawColor( renderer.get(), 0xFF, 0xFF, 0x00, 0xFF );
                for( int i = 0; i < 480; i += 4 )
                {
                    SDL_RenderDrawPoint( renderer.get(), 640 / 2, i );
                }

It will draw yellow points and blue line, but if i comment SDL_RenderDrawLine, it will draw nothing. What is wrong?

This will happen too, if i use this code and somewhere in code (after a while) i want to use SDL_RenderDrawPoint or SDL_RenderDrawPoints.

I am using lastest SDL library and Linux Mint.

0 个答案:

没有答案