Git Product home page Git Product logo

Comments (6)

wwforever avatar wwforever commented on August 17, 2024

The dll file associated with sdl2_image was copied and the texture was successfully loaded. But the controls do not look right.
gwork_sdl2_sample2

from gwork.

billyquith avatar billyquith commented on August 17, 2024

The dll file associated with sdl2_image was copied and the texture was successfully loaded.

The first image looks like it didn't find the skin texture, so I think think the default colour is red.

But the controls do not look right.

Second image shows a (potential) scissoring/clipping bug in SDL2. See #18.

If you have the latest SDL2 and latest Gwork (gwork branch) then this should be fixed and you should no longer see this problem.

from gwork.

wwforever avatar wwforever commented on August 17, 2024

@billyquith Thank you for answer. I am using the latest SDL2 (2.0.5) and the latest GWork. I'll check it again.

from gwork.

wwforever avatar wwforever commented on August 17, 2024
void SDL2::StartClip()
{
    return; //not clip
    const Gwk::Rect &rect = ClipRegion();

    int w, h;
    SDL_GetRendererOutputSize(SDL_GetRenderer(m_window), &w, &h);

    // Something wrong with clip rectangles in SDL2?
    // https://bugzilla.libsdl.org/show_bug.cgi?id=2700
    // =>   clip.y = screenHieght - clip.y - clip.h;
    const SDL_Rect clip = { rect.x, h - rect.y - rect.h, rect.w, rect.h };

    SDL_RenderSetClipRect(m_renderer, &clip);
}

void SDL2::EndClip()
{
    return; //not clip
    SDL_RenderSetClipRect(m_renderer, 0);
}

The source of the GWork I am using is the latest version. After temporarily blocking the clip processing by processing the return from StartClip and EndClip, I have confirmed that it works almost as close to normal. However, you can see that clipping is not working properly.

gwork_sdl2_clip_return

from gwork.

wwforever avatar wwforever commented on August 17, 2024
void SDL2::StartClip()
{
	const Gwk::Rect &rect = ClipRegion();
	const SDL_Rect clip = { rect.x, rect.y, rect.w,rect.h };
    //const Gwk::Rect &rect = ClipRegion();

    //int w, h;
    //SDL_GetRendererOutputSize(SDL_GetRenderer(m_window), &w, &h);

    //// Something wrong with clip rectangles in SDL2?
    //// https://bugzilla.libsdl.org/show_bug.cgi?id=2700
    //// =>   clip.y = screenHieght - clip.y - clip.h;
    //const SDL_Rect clip = { rect.x, h - rect.y - rect.h, rect.w, rect.h };

    SDL_RenderSetClipRect(m_renderer, &clip);
}

I went back to the previous revision of the issue #18 and found that it works fine. It seems to have fixed a bug related to SDL_RenderSetClipRect in the latest version of SDL2 2.0.5.

gwork_sdl2_clip_ok

from gwork.

billyquith avatar billyquith commented on August 17, 2024

Thanks for reporting this. It does indeed appear to not happen any more. I put in a test for versions of SDL2 pre 2.0.5.

from gwork.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.