Hi, I'm trying to write a plugin in C++ for my game, using the ags-plugin-dll-template.
My reason for wanting to write a plugin is that my game has 1600x1200 pixel scrolling backgrounds (16bit color depth, 800x600 resolution) that need to be dynamically drawn, not every game-loop or so, but when the player enters a new room.
Right now I'm using an ags-function that loops through the 1600x1200 pixels and paints bitmaps of different colored stars at random positions on the black background image, using RawDrawImage() and RawDrawImageTransparent(). This function is called when the player enters a new room, and the stars stay in the background once they've been painted on, just like if a premade bitmap with fixed stars was loaded as background pic.
Now I want somethig a little more complicated then just drawing a bunch of semitransparent bitmaps on top of and beside each other, in other words, i need access to a two-dimensional array containing the pixel information (rgb-values) for the background, so that I can manipulate each pixel manually from the .dll I'm writing, adjusting overlapping stars and creating other weird graphics effects, before the final pic is drawn to the background. But once the background is drawn, it needs to stay fixed for scrolling when the player moves.
In the template dll, there's a call to AGSE_POSTSCREENDRAW, but whatever is drawn here is translated as the player moves around the room, and doesn't stay fixed in the background.
How would I be able to draw on the real room background picture? Do I need to call GetRawBitmapSurface(BITMAP *bmp) ?Ã,Â
And what does the warning in the PlugIn API about this function only working with the virtual screen, mean? Isn't there a way to get and manipulate the real background picture?
- Fred
My reason for wanting to write a plugin is that my game has 1600x1200 pixel scrolling backgrounds (16bit color depth, 800x600 resolution) that need to be dynamically drawn, not every game-loop or so, but when the player enters a new room.
Right now I'm using an ags-function that loops through the 1600x1200 pixels and paints bitmaps of different colored stars at random positions on the black background image, using RawDrawImage() and RawDrawImageTransparent(). This function is called when the player enters a new room, and the stars stay in the background once they've been painted on, just like if a premade bitmap with fixed stars was loaded as background pic.
Now I want somethig a little more complicated then just drawing a bunch of semitransparent bitmaps on top of and beside each other, in other words, i need access to a two-dimensional array containing the pixel information (rgb-values) for the background, so that I can manipulate each pixel manually from the .dll I'm writing, adjusting overlapping stars and creating other weird graphics effects, before the final pic is drawn to the background. But once the background is drawn, it needs to stay fixed for scrolling when the player moves.
In the template dll, there's a call to AGSE_POSTSCREENDRAW, but whatever is drawn here is translated as the player moves around the room, and doesn't stay fixed in the background.
How would I be able to draw on the real room background picture? Do I need to call GetRawBitmapSurface(BITMAP *bmp) ?Ã,Â
And what does the warning in the PlugIn API about this function only working with the virtual screen, mean? Isn't there a way to get and manipulate the real background picture?
- Fred