Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Max2D] Add "render image" support (render2texture) #174

Merged
merged 1 commit into from
Feb 19, 2022

Conversation

GWRon
Copy link
Contributor

@GWRon GWRon commented Apr 20, 2020

requires the pub.mod-PR fixing some DirectX function definitions

@GWRon
Copy link
Contributor Author

GWRon commented Feb 20, 2021

Updated branch to contain all the current brl.mod changes

@GWRon
Copy link
Contributor Author

GWRon commented Nov 9, 2021

Updated branch (rebased).

Sample code still compiles and runs fine:

SuperStrict
Framework Brl.StandardIO
Import Brl.RandomDefault
Import Brl.GLMax2D
'Import Brl.D3D9Max2D
'Import SDL.D3D9SDLMax2D
'Import Sdl.GLSDLMax2D
'Import SDL.GL2SDLMax2D

Graphics(800, 600)
SetBlend AlphaBlend

Local rt:TRenderImage = CreateRenderImage(300, 150, False)

'render into the texture
SetRenderImage(rt)
For Local i :Int = 0 To 100
    SetColor Rand(0,255), Rand(0,255), Rand(0,255)
    DrawText("Hey", Rand(0, rt.width-50), Rand(0, rt.height-20))
Next
SetRenderImage(Null)

SetColor 255,255,255
SetClsColor 40, 80, 160
While Not KeyDown(KEY_ESCAPE)    
    Cls
    
    SetScale 2,2
    DrawImage(rt, MouseX(), MouseY())
    
    Flip
Wend

End

@braxtonrivers
Copy link

Thank you very much for this, working great here on win 10 x64

@GWRon GWRon force-pushed the feat_render2texture branch 3 times, most recently from a15ff71 to 625646b Compare December 14, 2021 10:54
@GWRon
Copy link
Contributor Author

GWRon commented Dec 14, 2021

Cleaned the PR with a soft-reset and rebase to upstream head (so includes the latest "long" changes)

@woollybah woollybah merged commit 42c3862 into bmx-ng:master Feb 19, 2022
@GWRon GWRon deleted the feat_render2texture branch February 21, 2022 14:21
@GWRon GWRon restored the feat_render2texture branch March 10, 2022 15:05
@GWRon GWRon deleted the feat_render2texture branch January 17, 2023 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants