Sign in to follow this  

dxRotateTexture and dxScaleTexture

Recommended Posts


My suggestion is to create two functions: dxRotateTexture and dxScaleTexture (ofc. for oop is Texture:rotate() and Texture:scale()) which will return new rotated and scaled texture or will work on texture in parameter. 

Share this post

Link to post

How are you using your texture? Functions such as dxDrawImage and dxDrawImage3D already have rotation arguments.

I don't work with shaders much either, but if you're using your texture with a shader I assume you can just rotate the texture using the shader itself.

Share this post

Link to post

You can already do that with render targets, i.e.:

  1. Create the render target with suitable dimensions
  2. Call dxSetRenderTarget(renderTarget)
  3. Draw the texture once using dxDrawImage (+ scale/rotate)
  4. Reset the render target: dxSetRenderTarget(nil)
  5. The resulting render target is your scaled/rotated texture

Share this post

Link to post

It's working! Nice, thanks.

One simple question: is this technique faster than normal calculations, for loops and dxSetPixelColor?

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.