Immediate mode rendering in C++?

Immediate mode rendering in C++?
0.0 0

#1

I posted this question on stackexchange four years ago:

(The reason is that I have some older game code that was originally written in immediate mode using Marmalade. It would be a huge amount of work to transform all of that immediate mode code to use nodes/scene graph.)

I’m trying to understand the current state of immediate mode rendering in cocos2dx. Is there an example project that someone can point me to? All I want to be able to do is start a frame, draw a bunch of sprites from a sprite sheet, and end the frame and have it rendered for me. (But I also want to take advantage of other cocos2dx features like sound and in-app purchase, so that’s why I’m not necessarily interested in a lower-level library.)


#2

I’d say you can use RenderTexture to accomplish this. Examples in cpp-tests. Here is the API doc: http://www.cocos2d-x.org/docs/api-ref/cplusplus/v3x/d9/ddc/classcocos2d_1_1_render_texture.html


#3

Thanks. But are you really saying I can use RenderTexture to create every frame of my game. And I’ll be able to do that at 30 fps? Does RenderTexture happen fully on the GPU or does it involve a lot of CPU?


#4

Sorry, you need this every frame? I thought you wanted to do this in just one frame at a time, when needed.

I read the answer and I’m not sure that anything has changed since that answer was posted. 3.x hasn’t undergone any major revisions to rendering since 3.0. However, 4.0 will be a very different beast and perhaps the new renderer we are working on will make it into v3.