I implemented splitscreen and it seems that everything I draw myself (99% of the game) doesn't work with the viewports. It just ignores it and renders fullscreen. The only thing that renders correctly is Irrlicht stuff like DrawLine.
How would I make my stuff work with viewports?
Splitscreen don't work with custom rendering
-
- Posts: 109
- Joined: Tue Jan 09, 2007 1:18 pm
Splitscreen don't work with custom rendering
Crimson Glory full Irrlicht game source code!
What I Do - my blog & dev log
Currently developing Link-Dead
What I Do - my blog & dev log
Currently developing Link-Dead
maybe you should show some of your code?
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
-
- Posts: 109
- Joined: Tue Jan 09, 2007 1:18 pm
It doesn't work for sprites and map rendering. Don't know about fonts.
I don't really use transform matrices. I just set the vertices of sprites and tiles in map rendering. Maybe that is the problem.
Here's how I render a map for example:
EDIT---------
No. I used a transform matrix instead of setting the vertices and it still doesn't work.
How does the viewport work? Is there something special that should happen before drawIndexedTriangleList?
I don't really use transform matrices. I just set the vertices of sprites and tiles in map rendering. Maybe that is the problem.
Here's how I render a map for example:
Code: Select all
driver->setTransform( irr::video::ETS_WORLD, matrix4() );
for (int i = 0; i < buffertiles.size(); i++)
{
if (buffertiles[i]->tileoffset > -1)
{
vector3df tilepos( (float)(buffertiles[i]->tileoffset % buffertilessize.Width ) * scale,
(float)floor( (float) (buffertiles[i]->tileoffset) / buffertilessize.Width ) * scale, 0.0f );
Vertices[0].Pos.X = -0.0f + tilepos.X;
Vertices[1].Pos.X = scale * 1.0f + tilepos.X;
Vertices[2].Pos.X = -0.0f + tilepos.X;
Vertices[3].Pos.X = scale * 1.0f + tilepos.X;
Vertices[0].Pos.Y = -0.0f + tilepos.Y;
Vertices[1].Pos.Y = -0.0f + tilepos.Y;
Vertices[2].Pos.Y = scale * 1.0f + tilepos.Y;
Vertices[3].Pos.Y = scale * 1.0f + tilepos.Y;
cellmaterial.TextureLayer[ 0 ].Texture = buffertiles[ i ]->texture;
if (usenormals)
cellmaterial.TextureLayer[ 1 ].Texture = normalbuffertiles[ i ]->texture;
driver->setMaterial( cellmaterial );
driver->drawIndexedTriangleList( &Vertices[0], 4, &ind[0], 2 );
}
}
EDIT---------
No. I used a transform matrix instead of setting the vertices and it still doesn't work.
How does the viewport work? Is there something special that should happen before drawIndexedTriangleList?
Crimson Glory full Irrlicht game source code!
What I Do - my blog & dev log
Currently developing Link-Dead
What I Do - my blog & dev log
Currently developing Link-Dead
Code: Select all
driver->setTransform( irr::video::ETS_WORLD, matrix4() );
-
- Posts: 109
- Joined: Tue Jan 09, 2007 1:18 pm
Woo!
DavidJE13: that's it. You've just won a medal
DavidJE13: that's it. You've just won a medal
Crimson Glory full Irrlicht game source code!
What I Do - my blog & dev log
Currently developing Link-Dead
What I Do - my blog & dev log
Currently developing Link-Dead