Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SuperStrict
- Framework xorsteam.xors3d
- Import brl.basic
- ' Window blah blah blah
- xCreateLog()
- xGraphics3D(800, 600)
- SeedRnd(MilliSecs())
- ' Texture dimensions
- Const TEX_SIZE:Int = 256
- ' Fill by WritePixel
- Local texture:Int = xCreateTexture(TEX_SIZE, TEX_SIZE)
- ' Fill texture random
- For Local j:Int = 0 Until TEX_SIZE
- For Local i:Int = 0 Until TEX_SIZE
- ' Generate random color
- Local color:Int = ColorARGB(255, Rand(255), Rand(255), Rand(255))
- ' Write pixel to texture 1
- xWritePixel(i, j, color, xTextureBuffer(texture)) 'texture1_buffer)
- ' Write pixel fast to texture 2
- 'xWritePixelFast(i, j, color, texture2_buffer)
- Next
- Next
- End
- ' Save buffers
- 'xSaveBuffer(texture1_buffer, "xors_test_writepixel.bmp")
- ' This function works fine! Tested in B3D, BlitzMax, MiniB3D and B3dSDK
- Function ColorARGB:Int(Alpha:Int, Red:Int, Green:Int, Blue:Int)
- Return ((Alpha And 255) Shl 24) Or ((Red And 255) Shl 16) Or ((Green And 255) Shl 8) Or (Blue And 255)
- EndFunction
Add Comment
Please, Sign In to add comment