Cocos2d Using the same - cocos2d-iphone

I need to create the same sprite, with the same image, like 50 - 100 times. I read that initializing them all by themselves creates a performance issue, is there a command to do this? if CCBatchNode is what should be used then please explain how it works. and YES i have searched the internet for like an hour now. any info would be appreciated. Thanks

Cocos2d loads the texture in the memory only once and keeps on using it for texture needs. So no problems with creating 100 references with same texture. It won't affect memory much.

Related

cocos2d-x What is the best practice to make a sprite every time I need it or just change its texture?

I need a similar asset changed on the screen with the same size, so, the best practice would be to change the texture of the sprite or make a new sprite and release the previous one? I see no difference on performance by now on my poker game I am making but I would like to know that maybe in the future implementing it on android would be a problem on performance, and so about the best practice on coding I don't see a mention of it on the documentation of cocos2d-x neither on the web. I really would like to know better what exactly goes on on both of the cases.
I would create a new Sprite each time.
I don't really think there will be any performance issues.
You could test the performance yourself on your desired target platform/s by doing a texture swap on a bunch of Sprites (100 or 1000 sprites) and then repeat the test with the same amounts of Sprite but creating them and releasing them.

DirectX 11 Rendering Object Inside out

I am having alot of struggles trying to follow Frank Luna's book for DirectX 11 3D Programming, and I am currently up to chapter 7 section 2. I have imported the Skull model file and I have begun to render it. The strange thing is that when I am rendering it, it appears to be rendering the back faces over the front facing faces. I am pretty sure this is the case of what is happening. But I am putting forth this question for help and guidance on where I may be going wrong. I will edit this post with inclusions of my code if required to help me figure out where I am going wrong, Thanks alot! (photo's attached)
Photo - Facing the Skull, Slightly to the Left
Photo - Above the Skull, Facing Downwards
EDIT: I have set a breakpoint in my code for after the first draw call loop and it does not show any faces which are behind the fronts ones, so issue is solved at this frame, but when I continue to the next frame, this is when the problems start.
These kinds of problems are sometimes related to the setup of the CullMode in the D3D11_RASTERIZER_DESC. Try changing from D3D11_CULL_BACK to D3D11_CULL_FRONT or vice versa. Also have a look at the FrontCounterClockwise option of the D3D11_RASTERIZER_DESC.
I figured out what had been causing my grief. I have been using DirectXToolKits SpriteFont and SpriteBatch class's to use the function DrawString to display an FPS counter at the top left corner of the screen, and it must have been messing around with the ID3D11DeviceContext::DrawIndexed calls. Thankyou for all your input and brainstorming!!

Optimize memory usage by cocos2d App : How to manage large package in cocos2d?

I have the problem with download a large package content in cocos2d when i bought a category.
It's 100 MB. I must be finish download to use this category.
It includes: Spritesheet, background, sound object. Each category has 20 objects.
Does anyone suggest for me an idea ? I don't want that the customer is taking up so much of their time.
For iPhone or Mac?
Check This: Cocos2d memory optimisation
Here is some of my suggestions that we did in one of our cocos2d iPhone game.
Used Jpeg2000 image formate for background image : bit increased loading time..but reduced app size.
Use Audio with bitrate 128 Kbps
Use Texture Packer to create spriteSheet and make sure you set NPOT option..by default its POT. See image for more information.

CMFCRibbonGallery Being slow

I am using the CMFCRibbonGallery control. I have 1 image it in comprised of 350 images total. Each image is 64hX128w. On the initial draw of the control it is slow. Every other time it is fast. I tried adding the 350 images individually at first but found that to be much slower cause it looks to be just making one large image like what I ended up doing. So I am wondering if there is anyway I can make this faster.
I ended up overloading OnDrawPaletteIcon which made me able to draw it much faster and manage the images myself.

Totally Stuck -- Need Models but none available - What to do?

So I've got this class where I have to make a simple game in OpenGL.
I want to make space invanders (basically).
So how in the world should I make anything appear on my screen that looks decent at all? :(
I found some code, finally, that let me import a 3DS object. It was sweet I thought and went and put it in a class to make it a little more modular and usable (http://www.spacesimulator.net/tut4_3dsloader.html).
However, either the program I use (Cheetah3d) is exporting the uv map incorrectly and/or the code for reading in a .bmp that ISN'T the one that came with the demo. The image is all weird. Very hard to explain.
So I arrive at my question. What solution should I use to draw objects? Should I honestly expect to spend hours guessing at vertices to make a space invader ship? Then also try to map a decent texture to this object as well? The code I am using draws the untextured object just fine but I can't begin to go mapping the texture to it because I don't know what vertices correspond to what polygons etc.
Thanks SO for any suggestions on what I should do. :D
You could draw textured quads, provided you have a texture loader.
I really wouldn't worry too much about your "uv map" - if you can get your vertices right then you can generally cludge something anyway. That's what I'd do.