Piorun Posted September 2, 2017 Share Posted September 2, 2017 Hi, 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. Link to comment
Administrators Lpsd Posted September 3, 2017 Administrators Share Posted September 3, 2017 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. Link to comment
Jusonex Posted September 3, 2017 Share Posted September 3, 2017 You can already do that with render targets, i.e.: Create the render target with suitable dimensions Call dxSetRenderTarget(renderTarget) Draw the texture once using dxDrawImage (+ scale/rotate) Reset the render target: dxSetRenderTarget(nil) The resulting render target is your scaled/rotated texture Link to comment
Piorun Posted September 3, 2017 Author Share Posted September 3, 2017 It's working! Nice, thanks. One simple question: is this technique faster than normal calculations, for loops and dxSetPixelColor? Link to comment
Recommended Posts