Can't draw a circle with orxDisplay_DrawCircle

edited May 2013 in Help request
Can't find any example of drawing a simple circle in screen. I tried by myself but not successful.

Tried

        orxSTATUS status;
	orxRGBA color;
	color.u8B = 255.0;
	orxVECTOR pos;
	pos.fX = 200.0;
	pos.fY = 200.0;

	status =  orxDisplay_DrawCircle(&pos,100.0,color,true);
and some variations but

I get status = 1 and nothing appears. I think i'm not working right with rgba.

ps: sry for bad english

Comments

  • edited May 2013
    Hi brielga,

    You need to fully specify your color, including the alpha value (aka opacity). Try:
    color = orxRGBA_Set(0, 0, 255, 255);
    
  • edited May 2013
    Tried that already but not worked, i'm trying to do this in object tutorial that i've downloaded.
  • edited May 2013
    Ah, from the object tutorial? I guess your code is in the Run() function then?

    Currently the orxDisplay_Draw*() functions are only supported from within the rendering time frame (ie. after orxRENDER_EVENT_START and before orxRENDER_EVENT_STOP).

    The usual method being to issue custom draw calls when receiving the render eventa for a dummy object, allowing the user to control the order of rendering within a scene.

    I can easily change the code to allow draw calls from outside that time period though. I'll update the code tonight. If you sync tomorrow, it should be working in your case. :)
  • edited May 2013
    thank you, this will help me a lot =)

    edit: can you do this for drawLine too?
  • edited May 2013
    It's in. It actually works for any render/draw call.
    What happened before is that your draw call was working, but the screen was cleared to black at the beginning of the first phase of rendering.
    Now the clearing happens right after the buffer swap, so any draw call in any place in your code should work.
Sign In or Register to comment.