Jump to content

Recommended Posts

Posted

Hi!

What's the best way to convert a buffer to a texture?

The only way I know of is using GetColorBuffer, but that also links the buffer to the texture and therefore doesn't fit my purpose.

 

Thanks :P

Oh and I'm posting here because I didn't get much response on my other thread.

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Posted

You can use CopyBuffer(GetColorBuffer(),BUFFER_COLOR) to get only the texture which is not linked to the original buffer.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Posted

Thank you, I'm aware of that but I don't want any linking with any buffers.

I'm not sure they're freed correctly when linked to a texture, my program crashes after x amount of GetColorBuffers.

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Posted

You should always free the buffer yourself and not wait for the engine to do it.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Posted

There's no FreeBuffer command in BlitzMax, I'm just using Buffer = Null.

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Posted

I'm not sure what FreeBuffer() does, but I would assume it also sets the buffer to null and then calls garbage collection to make sure it's released immediately and not at some random point which will make your program crash.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Posted

Even if I can get it freed correctly I'd still prefer a way without having to copy the buffer.

Creating a buffer or doing GetColorBuffer is pretty slow, my program freezes like 250ms on my Laptop when I call them.

(Which is not good since I use A LOT of both of these commands for my Render to Texture interface)

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Posted

I think I've got the buffers to free correctly now! :)

But still the performance on using CreateBuffer and GetColorBuffer to do a 'Render to Texture' routine is very poor :/

There must be a better way of doing this! >.<

Core2Duo, 3.33GHz, Radeon HD 5850 Black Edition, 4GB RAM, 4 TB HDD, Windows 7.

Core2Duo, 2.00GHz, Geforce 9500m, 4GB RAM, 320 GB HDD, Windows 7.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...