CEGUI - As object

BlitzMax Modules Forums/Brucey's Modules/CEGUI - As object

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Thanks very much :-)

You have continued to help me beyond belief.

Nah... I just don't like to see anyone getting stuck with issues while using my modules.
Although, usually I need to work it all out myself first to be able to provide an answer - Language-bindings are just that... doesn't necessarily mean I have any idea what is going on myself ;-)

But we seem to get there in the end.

The thing I like with BlitzMax (still, and I've mentioned it before), is how nice it is to be able to call back and forth between it and c/c++... so that you can do this :
Type CustomResourceProvider Extends TCEResourceProvider

	Method loadRawDataContainer(filename:String, dataContainer:TCERawDataContainer, resourceGroup:String)
		
		DebugLog "Loading file : " + filename
		
		Local stream:TStream = ReadStream(filename)
		
		Local size:Int = stream.Size()
		
		' create some memory - we will free this later
		Local data:Byte Ptr = MemAlloc(size)
		
		stream.ReadBytes(data, size)
		stream.Close()
		
		' Set size and data within container
		dataContainer.SetSize(size)
		dataContainer.SetData(data)
	End Method

	Method unloadRawDataContainer(dataContainer:TCERawDataContainer)
	
		Local data:Byte Ptr = dataContainer.GetDataPtr()
		
		If data Then
			' free our data
			MemFree(data)
			' we also need to Null out the pointer within the container
			dataContainer.SetData(Null)
		End If
	End Method

End Type

and be happy in the knowledge that the framework will look after calling these methods for you. BlitzMax rocks :-)