loading/saving image texture, CreateTexFromFile(...), etc

This forum is currently in read-only mode.
  • trying to find the definition for :

    virtual TextureHandle CreateTextureFromFile(PCTSTR filename, texture_format format = cr::texture_format_a8r8g8b8)

    basically I'm trying to figure out how to load/save texture from/to a file containing the img data along with other info, if necessary using binary fstream functions. the files will always be in png format before being combined with the other info.

    I'd appreciate any help on this front

  • [quote:1xw7p0k5]trying to find the definition for :

    virtual TextureHandle CreateTextureFromFile(PCTSTR filename, texture_format format = cr::texture_format_a8r8g8b8)

    The function is defined on line 1304 of this file:

    Common/Renderers/CDX9Renderer.cpp

    Hope that helps.

  • Thanks rojo, though I had already found it. Wasn't quite what I needed. I was actually hoping you would respond to this thread, since you had created the resource plugin I thought maybe you'd have some insight into the problem. Basically I want to be able to create custom resource files, I was hoping for a simple solution. Sort of like fstream, but where I could include pngs and maybe sounds along with it. I did find one solution on a gamedev site I'll use if there's nothing elsewhere in the sdk that can help...anything you've stumbled upon that might help?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Construct's functions probably won't help with this - why not get libpng or something like that and do it yourself?

  • I'll trying to make reload sprite image at edit time, but can't get it to work

    (it's modified sprite plugin)

    I've made CString variable to save path to image and button which reloads sprite image from disk.

    Function looks like this

    int tex = pEditTime->AddTextureFromFile(spritePath)

    iTexture = pEditTime->AddImageAsTexture(image)

    pEditTime->SetTexture(iTexture)

    but does nothing help please))

  • One more feature I'm dreaming about is loading sprites at realtime and edittime.

    Says you just need to specify folder where from to load sequences and prefix for frame count and file extension. Action look for subfolders and creates new animations for each one with name of subfolder. Then for every subfolder it loads amount of frames equal to amount of files. If there is no subfolders then it just loads image into sprite.

    I think it will be very usable for everybody if someone make this. For me it's very needed feature because artists always improves animations and sprites and for now you need to reload it manually every time using image editor.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)