Results 1 to 6 of 6

Thread: Showing a pSDL_SURFACE on TCanvas on form?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    If worrying about slowness, this is the cause:
    Code:
    Canvas.Pixels[I,J]:= Loc^;
    Using Canvas functions to draw is always slow. Since you started making SDL screen, you could look into drawing with SDL too.

    When drawing on a form canvas, and then moving window outside of screen and back, all drawn graphics disappear. With no SDL or other graphics API this is fixed by drawing on TImage.Picture.Bitmap.Canvas. You don't need to handle onPaint event then, because you can be sure that what you draw once will remain forever.

  2. #2
    Frankly, I think it will be easier to do all the drawing in SDL and just have your editor work with two separate windows, the SDL-rendered one and the form-designer one. Just create a timer on the form to periodically check for SDL events and update the display surface if necessary, and that's pretty much all. You could, eventually, go with having all SDL-related stuff handled in a thread, but, in my own experience, that's too much of a complication in exchange for very little benefit.

  3. #3
    Doesent SDL_CreateWindowFrom alows you to use existing GUI window to render SDL content to so you don't have to create a new SDL window?

  4. #4
    It is possible in SDL2. Glancing at the code, I think T-Bear is using SDL1, which does not allow that. Maybe with some awful hacking.

  5. #5

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •