The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
using SDL_RTF : link error on SDL_RenderGetClipRect()
jeroen.clarysse


Joined: 22 Feb 2010
Posts: 69
basically, the function ecRenderText makes calls to SDL_RenderGetClipRect() and SDL_RenderSetClipRect(), but with an SDL_renderer as first parameter, which doesn't work anymore (since SDL2 ?)

I commented out the lines and everything seems to work, but thought I'd report it


modified code below


int ecRenderText(RTF_Context *ctx, const SDL_Rect *rect, int yOffset)
{
// SDL_Renderer *renderer = (SDL_Renderer *)ctx->renderer;
RTF_Line *line;
// SDL_Rect savedRect;

ecReflowText(ctx, rect->w);

// SDL_RenderGetClipRect(renderer, &savedRect);
// SDL_RenderSetClipRect(renderer, rect);
for (line = ctx->start; line && yOffset < rect->h; line = line->next)
{
if (yOffset + line->lineHeight > 0)
RenderLine(ctx, line, rect, yOffset);
yOffset += line->lineHeight;
}
// SDL_RenderSetClipRect(renderer, &savedRect);

return ecOK;
}

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
using SDL_RTF : link error on SDL_RenderGetClipRect()
MrOzBarry


Joined: 26 Jun 2010
Posts: 620
Are you using the copy from github or from libsdl.org?  The github mirror is over two years old, where the libsdl.org mercurial version is the main source and always up to date.

On Tue, Mar 31, 2015 at 4:16 AM, jeroen clarysse wrote:
Quote:

basically, the function ecRenderText makes calls to SDL_RenderGetClipRect() and SDL_RenderSetClipRect(), but with an SDL_renderer as first parameter, which doesn't work anymore (since SDL2 ?)

I commented out the lines and everything seems to work, but thought I'd report it


modified code below


int ecRenderText(RTF_Context *ctx, const SDL_Rect *rect, int yOffset)
{
//    SDL_Renderer *renderer = (SDL_Renderer *)ctx->renderer;
    RTF_Line *line;
//    SDL_Rect savedRect;

    ecReflowText(ctx, rect->w);

//    SDL_RenderGetClipRect(renderer, &savedRect);
//    SDL_RenderSetClipRect(renderer, rect);
    for (line = ctx->start; line && yOffset < rect->h; line = line->next)
    {
        if (yOffset + line->lineHeight > 0)
            RenderLine(ctx, line, rect, yOffset);
        yOffset += line->lineHeight;
    }
//    SDL_RenderSetClipRect(renderer, &savedRect);

    return ecOK;
}

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
using SDL_RTF : link error on SDL_RenderGetClipRect()
jeroen.clarysse


Joined: 22 Feb 2010
Posts: 69
the mercurial source :

(do a find on "ecRenderText"and you'll see the cliprect routines )

http://hg.libsdl.org/SDL_rtf/file/c9210d3944ad/SDL_rtfreadr.c





Quote:
On 31 Mar 2015, at 15:45, Alex Barry wrote:

Are you using the copy from github or from libsdl.org? The github mirror is over two years old, where the libsdl.org mercurial version is the main source and always up to date.

On Tue, Mar 31, 2015 at 4:16 AM, jeroen clarysse wrote:

basically, the function ecRenderText makes calls to SDL_RenderGetClipRect() and SDL_RenderSetClipRect(), but with an SDL_renderer as first parameter, which doesn't work anymore (since SDL2 ?)

I commented out the lines and everything seems to work, but thought I'd report it


modified code below


int ecRenderText(RTF_Context *ctx, const SDL_Rect *rect, int yOffset)
{
// SDL_Renderer *renderer = (SDL_Renderer *)ctx->renderer;
RTF_Line *line;
// SDL_Rect savedRect;

ecReflowText(ctx, rect->w);

// SDL_RenderGetClipRect(renderer, &savedRect);
// SDL_RenderSetClipRect(renderer, rect);
for (line = ctx->start; line && yOffset < rect->h; line = line->next)
{
if (yOffset + line->lineHeight > 0)
RenderLine(ctx, line, rect, yOffset);
yOffset += line->lineHeight;
}
// SDL_RenderSetClipRect(renderer, &savedRect);

return ecOK;
}

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
using SDL_RTF : link error on SDL_RenderGetClipRect()
MrOzBarry


Joined: 26 Jun 2010
Posts: 620
Well, SDL only implemented renderers since SDL 1.3/2.0, so that's not legacy code.  What version of SDL is the compiler linking against?

-Alex


On Tue, Mar 31, 2015 at 9:49 AM, jeroen clarysse wrote:
Quote:
 the mercurial source :

(do a find on "ecRenderText"and you'll see the cliprect routines )

http://hg.libsdl.org/SDL_rtf/file/c9210d3944ad/SDL_rtfreadr.c





Quote:
On 31 Mar 2015, at 15:45, Alex Barry wrote:

Are you using the copy from github or from libsdl.org?  The github mirror is over two years old, where the libsdl.org mercurial version is the main source and always up to date.

On Tue, Mar 31, 2015 at 4:16 AM, jeroen clarysse wrote:

basically, the function ecRenderText makes calls to SDL_RenderGetClipRect() and SDL_RenderSetClipRect(), but with an SDL_renderer as first parameter, which doesn't work anymore (since SDL2 ?)

I commented out the lines and everything seems to work, but thought I'd report it


modified code below


int ecRenderText(RTF_Context *ctx, const SDL_Rect *rect, int yOffset)
{
//    SDL_Renderer *renderer = (SDL_Renderer *)ctx->renderer;
     RTF_Line *line;
//    SDL_Rect savedRect;

     ecReflowText(ctx, rect->w);

//    SDL_RenderGetClipRect(renderer, &savedRect);
//    SDL_RenderSetClipRect(renderer, rect);
     for (line = ctx->start; line && yOffset < rect->h; line = line->next)
     {
         if (yOffset + line->lineHeight > 0)
             RenderLine(ctx, line, rect, yOffset);
         yOffset += line->lineHeight;
     }
//    SDL_RenderSetClipRect(renderer, &savedRect);

     return ecOK;
}

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org