How to make a device that can tiled build?


I made a my device. and it works well.

I want to make the device for tiled build.

I changed below code.

[code]virtual bool isExporting(OUTPUT_MODE mode) { return false; }[/code]

virtual bool isExporting(OUTPUT_MODE mode) { return true; }

and I found some problem.

doOutput(OutputSet& outset, OUTPUT_MODE output_mode)

output_mode value has OUTPUT_TILED.
but outset value has strange value.

How to make a device that can tiled build?

The OutputSet encapsulates all of the data inputs that are active going into your Output device. Thus if your output takes many inputs and produces a single file, it will be provided with
all of those inputs which can be retrieved by iterating over outset.get(x) where x is in 0…outset.num()

OutputSet &outset should contain a reference to an OutputSet object (defined in IODevices.h) that you can use to retrieve your data for saving, for example:

HField *hf = HF(outset.get(0)); // retrieve a heightfield type input

If your not seeing a valid OutputSet object on the outset parameter, we then have a different issue at hand!

I made simple logging code for test the outset value.

#include <fstream>
bool SimpleOutput::doOutput(OutputSet &outset, OUTPUT_MODE output_mode) {
	assert(false && "TODO: doOutput() implementation!");

	std::ofstream of;"check outset value.txt", std::ios_base::out | std::ios_base::app);

	if (output_mode == OUTPUT_TILED)
		int n = outset.num();
		of << "tiled outset num : " << n << std::endl;
		int n = outset.num();
		of << "normal outset num : " << n << std::endl;

	return false;

and I built each way.

it’s a result.

normal outset num : 1 tiled outset num : -10942447 tiled outset num : 525928465 tiled outset num : -10942447 tiled outset num : 525928465

I think outset value broken.

My computer spec is below
compiler : VS 2008, compile option release x64.
cpu : Intel Core2 Quad CPU Q8200
OS : windows 7 64bit
memory : 8GB

Could you send me sample code can tiled build device?

hmm. I just performed a check by essentially copy-pasting your doOutput function and it works successfully for me using the 2.2 PDK and WM 2.2 Pro executable.

The only unaccounted for variable is that different versions of the MSVC compiler can break binary compatibility with libraries – I’ve noticed this in particular with the STL implementation changing between editions. C++'s lack of a native ABI is what really hurts here. If you can get your hands on the VC2005 compiler, my suspicion is that your code will work successfully.

I changed my compiler to 2005.

It works well. Thank you. :smiley: