Crash when rendering model as well as font

View previous topic View next topic Go down

Crash when rendering model as well as font

Post  AstAn on Wed Sep 09, 2009 12:15 pm

I can render a font or a model without any problem but when I am rendering both I get a crash EXC_BAD_ACCESS. The font is from a different package than the camera and the model. Another strange thing that happens is that the font seems to have the same vertex colours as the model like they are both sharing the same buffer.


It would be nice if someone could push me into the right direction. For me it seems like both use the same vertex buffer and both try to free it.

Daniel

AstAn

Posts : 12
Join date : 2009-08-22

View user profile

Back to top Go down

Re: Crash when rendering model as well as font

Post  IanLinart on Wed Sep 09, 2009 2:07 pm

Can you post your init code?
avatar
IanLinart

Posts : 26
Join date : 2009-08-12
Age : 28
Location : Montréal

View user profile http://iapps.linart.qc.ca

Back to top Go down

Re: Crash when rendering model as well as font

Post  AstAn on Wed Sep 09, 2009 2:36 pm

Which part of the init code? I have wrapped a lot of stuff so it is not like I have one method that I could post here.

AstAn

Posts : 12
Join date : 2009-08-22

View user profile

Back to top Go down

Re: Crash when rendering model as well as font

Post  oioioi on Wed Sep 09, 2009 2:48 pm

If you use sio2objectRender to render your object you have to call sio2objectReset after rendering the model, if you use sio2ResourceRender this is not the problem

oioioi

Posts : 136
Join date : 2008-12-02
Location : Norway

View user profile

Back to top Go down

Re: Crash when rendering model as well as font

Post  AstAn on Wed Sep 09, 2009 3:18 pm

Thanks that was exactly the problem.

Another problem I have is that the font I render is overdrawing:



I wonder how that happens as the buffers are cleared each frame.

AstAn

Posts : 12
Join date : 2009-08-22

View user profile

Back to top Go down

Re: Crash when rendering model as well as font

Post  sio2interactive on Wed Sep 09, 2009 3:24 pm

Like oioioi was saying you have to manage the state... so you have to reset what you have set on...

sio2ObjectReset();
sio2MaterialReset();
sio2FontReset();
sio2WidgetReset();

etc...

You can find more information in the code comments of the tutorials...

_________________
SIO2 Interactive
Free Open Source 3D Game Engine for iPhone and iPod Touch
http://sio2interactive.com
avatar
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 38
Location : Shanghai

View user profile http://sio2interactive.com

Back to top Go down

Re: Crash when rendering model as well as font

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum