User Tools

Site Tools


en:examples:drawing:drawing_lines

Drawing Lines

Code

orxSTATUS orxFASTCALL RenderEventHandler(const orxEVENT *_pstEvent) {
	if (_pstEvent->eType == orxEVENT_TYPE_RENDER){
		if(_pstEvent->eID == orxRENDER_EVENT_STOP){ 
 
			orxRGBA lineColour;
			lineColour.u8R = 255;
			lineColour.u8G = 128;
			lineColour.u8B = 90;
			lineColour.u8A = 255;
 
			orxVECTOR lineStart = {0, 0, 0};
			orxVECTOR lineEnd = {800, 600, 0};
 
			orxDisplay_DrawLine ( &lineStart, &lineEnd, lineColour);
 
		}
	}
 
	return orxSTATUS_SUCCESS;
}
 
orxSTATUS orxFASTCALL Init()
{
...
	orxEvent_AddHandler(orxEVENT_TYPE_RENDER, RenderEventHandler);
...

en/examples/drawing/drawing_lines.txt · Last modified: 2018/02/14 00:47 (7 years ago) by 127.0.0.1