I haven’t been able to find the TileRender implementation in Cinder 0.9.0. Does it still exist? If not, does anyone have any suggestions on how to re-create this functionality? is it even possible in 0.9.0.
Looking at the source code, it looks like it should run with very minimal modification. Just change the raw gl calls to use their gl::* counterparts and bob’s your mother’s brother.
edit
Excuse the formatting, fighting against you “tab” heretics.
Using the same header from 0.8.6 ( except changing the Vec2i to ivec2 ), this seems to do the trick. One thing to be aware of, you may want to change TileRender::getSurface() to return a const ref, because i believe this used the old implicitly shared object paradigm where copying a Surface wouldn’t trigger a copy of the underlying data, whereas now i’m pretty sure it does, and being that this class is for rendering giant images, it’s a copy you definitely want to avoid.
Got 3 compile-time errors for unresolved externals related to the “gl::TileRender tr” iinstance.
1>EarthquakeApp.obj : error LNK2019: unresolved external symbol “public: __thiscall cinder::gl::TileRender::TileRender(int,int,int,int)” (??0TileRender@gl@cinder@@QAE@HHHH@Z) referenced in function “public: virtual void __thiscall EarthquakeApp::keyDown(class cinder::app::KeyEvent)” (?keyDown@EarthquakeApp@@UAEXVKeyEvent@app@cinder@@@Z)
1>EarthquakeApp.obj : error LNK2019: unresolved external symbol “public: bool __thiscall cinder::gl::TileRender::nextTile(void)” (?nextTile@TileRender@gl@cinder@@QAE_NXZ) referenced in function “public: virtual void __thiscall EarthquakeApp::keyDown(class cinder::app::KeyEvent)” (?keyDown@EarthquakeApp@@UAEXVKeyEvent@app@cinder@@@Z)
1>EarthquakeApp.obj : error LNK2019: unresolved external symbol “public: void __thiscall cinder::gl::TileRender::setMatrices(class cinder::Camera const &)” (?setMatrices@TileRender@gl@cinder@@QAEXABVCamera@3@@Z) referenced in function “public: virtual void __thiscall EarthquakeApp::keyDown(class cinder::app::KeyEvent)” (?keyDown@EarthquakeApp@@UAEXVKeyEvent@app@cinder@@@Z)
1>E:\libs\cinder\samples\Earthquake\vc2013\Debug\Earthquake.exe : fatal error LNK1120: 3 unresolved externals
The weird thing is that I’m using Visual Assist X and its Intellisense sees all of the methods the compiler is complaining about as being available to the “gl::TileRender tr” instance.
Just to be sure I didn’t mess up something, I cleaned the Cinder solution and repeated all the steps above. Same problem persists.
My question is since Tilerender has been removed from 0.9.0 has something fundamentally changed about Cinder that makes using the Tilerender simply impossible? If so, can anyone suggest an alternate method of saving out huge images from Cinder?
You’ll need to add TileRender.cpp to the cinder solution (and recompile it) otherwise it won’t be compiled and included in the static library; just having it exist on the filesystem isn’t enough. You could also add the .cpp to your project too, though that’s a slightly dirtier way around it.
Hey @lithium - This is a bit of an older thread but didn’t feel like I needed to create a new one to ask this:
I was able to get TileRenderer setup and working no problem with the most recent version of Cinder as long as I’m not running my app using the high density enabled flag. If I set the app to run with setHighDensityEnabled(true), the output of the TileRenderer is only a single solid texture of whatever the gl::clear color is set to, but none of the draw commands show up in the output image. Any idea how I might be able to modify it to work with a high density app?
Do you have any idea why it was removed from core after 0.8x? After looking at it, I thought maybe it was just a simple enough class that people could implement on their own if they needed it?
I have no idea why it was removed, as it took minimal effort to make it (sort of) work in 0.9.0. Looking at it now, there’s definitely some points vs pixels issues here for high density displays. For starters, any reference to app::getWindow{Width|Height}() needs to be wrapped in a app::toPixels() to scale it by the window content scale. With any luck that’s all you’ll need to do, but it’s definitely a good place to start.