Results 1 to 2 of 2

Thread: Possible Bug: Canvas::draw_point method is not drawing the point at (0,0)

  1. #1

    Exclamation Possible Bug: Canvas::draw_point method is not drawing the point at (0,0)

    Hi.

    I was testing the ClanLib 3.0.1 from this package: ClanLib-VC11Precompiled-static-mt-Win32-3.0.1.zip

    When I try to draw the pixel at (0,0) with the draw_point of the canvas, the pixel is not shown on screen.
    On the screenshot below I've drawn a pixel at (0,1) (please zoom the imagem at top left corner), but if I draw the pixel at (0,0), I can't see the pixel on screen.
    Is this a bug of the ClanLib or am I doing something wrong?

    Canvas class: https://github.com/renannprado/ClanL....cpp?source=cc
    My TicTacToe (Hello World) project: https://github.com/renannprado/ticta...es/basic2d.cpp (please take a look at line 65)


    Attachment 26744

    Thanks

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    You probably won't get any responses, mainly because nobody uses this function.

    In theory, draw_point(x,y) should draw to (x,y) in clanD3D, clanGL (legacy or opengl 3.2+) and clanSWRender.

    I am not sure why it doesn't. (I haven't got time to explore why).

    All the RenderBatchers (points, lines and triangles) use similar code. I'm not sure why it breaks for just points.

    Sources\Display\2D\render_batch_*.cpp contains the batchers

    The reason nobody uses the function is because, by nature it's slow when drawing numerous points. If drawing over 1000 points (of a pixel in size) it's better to use a custom shader and use gc.draw_primitives(type_points, ....)
    If drawing points larger than a pixel, point sprites are an option ( Examples\Display_Render\PointSprite\Sources\app.cp p is an example, although that example could be written better )

Similar Threads

  1. Canvas
    By Lief in forum Suggestion Box
    Replies: 1
    Last Post: 01-22-2014, 09:33 AM
  2. Canvas wall
    By firerfight in forum Suggestion Box
    Replies: 10
    Last Post: 03-13-2013, 09:38 PM
  3. Canvas flushing
    By Judas in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 11-08-2012, 11:31 AM
  4. texture drawing method questions
    By ppheathead in forum Official ClanLib SDK Forums
    Replies: 5
    Last Post: 06-10-2009, 07:19 AM
  5. canvas
    By Krux in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 08-30-2007, 04:30 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
  •