Results 1 to 5 of 5

Thread: Rendering into my custom image and then drawing this image to the display

  1. #1

    Default Rendering into my custom image and then drawing this image to the display

    Hello to all,

    How can I draw some rectangles and text strings into my custom image (or, maybe, custom pixel buffer or custom graphic context)? And then draw this graphic context on the screen?

    This is needed when I have a lot of static text to be drawed, because of the simple font.draw() is very slow for the real-time rendering with good FPS's (when there are > 1000 symbols).

    Thanks!
    Alexey.

  2. #2

    Default

    Why not load images of the text? Does it need to be created at runtime?

  3. #3

    Default

    Thank you for your reply, Adam!

    Of course, it is needed to be created during runtime. Just imaging such situation: we use a transparent richtext control (which is similar to the NotePad's client area) and load a big amount of text. And there are some other animated graphics elements behind this richedit control. So, we need to redraw the text each frame (for example, 40 times per second) to produce a nice animation of that graphics elements.

    But when it draws of about 500-1000 chars simultaneously, the FPS slows down to 20-15 on my Pentium IV 2800.

    Of course, the first thing that occurs in mind - to render this text to some custom buffer after each text changing, window resizing or scrolling position changing.

    If you have any other proposition, it'll be appeciated!

    (For more info about the richtext control I'm telling about see my topics on http://www.rtsoft.com/forums/showthread.php?t=1718 ).

    Regards,
    Alexey.

  4. #4
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    Look into the Canvas class, and the Canvas example. It lets you render to a texture which you can then draw later on.

  5. #5

    Default

    Thanks!

    I'll try to do it in a few days and tell you about results.

    Regards,
    Alexey.

Similar Threads

  1. Display targets and input
    By void_kill in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 03-23-2007, 11:56 PM
  2. Image Drag&drop
    By jimbo in forum Novashell Game Creation System
    Replies: 0
    Last Post: 12-08-2006, 11:48 PM
  3. Clanlibs display errors
    By megumiaraki in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 12-07-2006, 07:20 AM
  4. Drawing/displaying problem
    By shade37337 in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 10-21-2006, 05:11 PM
  5. Image help
    By in forum Dink Smallwood HD
    Replies: 2
    Last Post: 02-04-2004, 08:42 PM

Bookmarks

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
  •