draw simple pixel in IGUIWindow

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Fk
Posts: 6
Joined: Thu Jul 10, 2008 12:46 pm
Location: Russia
Contact:

draw simple pixel in IGUIWindow

Post by Fk »

How can I do that? How can I draw graph, not static image, not texture, just simple pixel in my window(IGUIWindow)?
//I'm from Russia, so excuse me for my little english.
And I not want to create new driver for doing "driver->draw2DLine(x,y,x,y)" - I think it's not cool =\
doqkhanh
Posts: 158
Joined: Sat Mar 01, 2008 3:14 am
Location: Tokyo, Japan
Contact:

Post by doqkhanh »

I think you can view the code in Irrlicht source, may be the draw2Dline function to show how irrlicht draw a pixel...

Hope this helpul!
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

You could create yourself a texture and display that in the window and then edit the pixels of the texture as required. look at ITexture::lock()
Image Image Image
Fk
Posts: 6
Joined: Thu Jul 10, 2008 12:46 pm
Location: Russia
Contact:

Post by Fk »

ok, thanks, I thought that irrlicht should give me that chance to simple draw point, becouse it's so trivial! o_O =(
Last edited by Fk on Thu Jul 10, 2008 2:54 pm, edited 1 time in total.
Fk
Posts: 6
Joined: Thu Jul 10, 2008 12:46 pm
Location: Russia
Contact:

Post by Fk »

JP wrote:You could create yourself a texture and display that in the window and then edit the pixels of the texture as required. look at ITexture::lock()
thanks, I'll try it
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

I'm curious how you intend to draw a graph with points instead of lines (unless you are doing a scatter plot) and make it cool. Most of the cool graphs are based on lines, bars or pies. :)

BTW, I wrote a line graph gui element a while back. I have it at home and I could post the code if you'd like.

Travis
Fk
Posts: 6
Joined: Thu Jul 10, 2008 12:46 pm
Location: Russia
Contact:

Post by Fk »

I writing code that will output graph of my math function to IGUIWindow. And that graph must be resizeable as window by wheel.
=>window(IGUI)=>image=>texture
I recompiled engine. Window is resizeable by wheel now. And image too.

Code: Select all

if(event.EventType == EET_MOUSE_INPUT_EVENT && event.MouseInput.Event==EMIE_MOUSE_WHEEL) ViewGraph++;

Code: Select all

while(device->run()){
	driver->beginScene(true, true, video::SColor(0,100,100,100));
	if(ViewGraph>1) img->setRelativePosition(core::rect<s32>::rect(4,20,window->getAbsolutePosition().getWidth()-5,window->getAbsolutePosition().getHeight()-5));
Now I have problem with texture and her size. But I think I cope with it.
If you have a code help me, so write it, thanks. =)

Excuse me for my little english again. :oops:
Post Reply