Results 1 to 4 of 4

Thread: Freeing up resources at runtime

  1. #1
    Squire crix's Avatar
    Join Date
    Jan 2012
    Location
    SWEDEN
    Posts
    10

    Default Freeing up resources at runtime

    Question 1:
    If I have "CL_Texture" object with data, taking up graphics memory, is it possible to remove that "CL_Texture" object at runtime? I don't find any class function for it.

    Question2:
    If I create a new "CL_Texture" object with "new" command and then "delete" it does that free up the memory it uses on the GPU? (see example code below)

    CL_Texture* tex = new CL_Texture();
    ...
    delete tex;


    Thankful for an answer since I can't figure it out myself hehe!

  2. #2
    Squire crix's Avatar
    Join Date
    Jan 2012
    Location
    SWEDEN
    Posts
    10

    Default

    Is this the way perhaps? I get the pointer to the "CL_TextureProvider" and call the "destroy" method?

    Code:
    CL_TextureProvider* tp = tex.get_provider();
    tp->destroy();

    After that "CL_Texture" class function "is_null()" returns true.

  3. #3
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Bergen, Norway
    Posts
    588

    Default

    tex = CL_Texture()

    should set the texture to an empty texture (and free up the previous if no one else is referring to it).

  4. #4
    Squire crix's Avatar
    Join Date
    Jan 2012
    Location
    SWEDEN
    Posts
    10

    Default

    Quote Originally Posted by sphair View Post
    tex = CL_Texture()

    should set the texture to an empty texture (and free up the previous if no one else is referring to it).
    Ok. Thanks for the answer!

Similar Threads

  1. Freeing texture memory
    By gdbfun in forum Proton SDK
    Replies: 1
    Last Post: 12-23-2010, 01:08 PM
  2. clanlib 2.2.5 CL_mutex runtime error
    By lymantok in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 11-12-2010, 09:44 PM
  3. clanlib 2.2.5 dicewar unhandled exception at runtime
    By lymantok in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 11-12-2010, 09:24 PM
  4. Freeing memory after use of sound buffers ??
    By babyvegas in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 08-21-2008, 08:25 PM
  5. Runtime Error with ClanLib Applications
    By Wotfreak in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 08-23-2007, 01:47 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •