I called this function once per frame and it took my FPS from >400 to 33. Why?
sw blt(const PtRect *dstRect, Texture *src, const PtRect *srcRect, RenderDevice::bltFlags flags=RenderDevice::bltDefault)
{
assert(src);
GL_Texture *glsrc = dynamic_cast<GL_Texture*>(src);
if (glsrc == 0)
return -1;
PtRect srcRect2(0, 0, src->width, sr...
In Pygame, there is a special_flags argument to surface.blit. This let you combine pixels in ways different than simply copying them. For example, the multiply mode lets you multiply the pixels together.
How do I achieve this using SDL from C? I've looked at the SDL documentation, and I don't see any obvious ways of doing this.
...
I have a UIView subclass onto which I need to blit a UIImage. There are several ways to skin this cat depending on which series of APIs you prefer to use, and I'm interested in the fastest. Would it be UIImage's drawAtPoint or drawRect? Or perhaps the C-based CoreGraphics routines, or something else? I have no qualms about altering my so...
I'm trying to blit a PNG image onto a surface, but the transparent part of the image turns black for some reason, here's the simple code:
screen = pygame.display.set_mode((800, 600), pygame.DOUBLEBUF, 32)
world = pygame.Surface((800, 600), pygame.SRCALPHA, 32)
treeImage = pygame.image.load("tree.png")
world.blit(treeImage, (0,0), (0,0...
Just wondering...
Is there any way to clear a surface from anything that has been blitted to it?
...
What I am trying to do is create a viewport to view a small portion of a background. (And later put sprites in).
However the problem I have noticed is there seems to be an issue of the background blurring when it starts moving. I was not sure if this is because blitting is slow or because of a problem in the code. I was looking for exam...
Hello, I'm making a game with python and OpenGL. I was making it with pygame but I realised quick enough that it was too slow. I've made a class which I want to reasonably act like the Surface class for pygame, where Surface objects can be blitted to other Surface objects. I'm wishing to use framebuffers for rendering textures to texture...
I'm working on a thing where I want to have the output option to go to a video overlay. Some support rgb565, If so sweet, just copy the data across.
If not I have to copy data across with a conversion and it's a frame buffer at a time. I'm going to try a few things, but I thought this might be one of those things that optimisers w...
I have two BitmapData objects with alpha channels. I'd like to combine them into a single one by using max(channel_image_one, channel_image_two) for each channel, including the alpha. Is there an easy way to achieve this result?
...
I'm used to handle graphics with old-school libraries (allegro, GD, pygame), where if I want to copy a part of a bitmap into another... I just use blit.
I'm trying to figure out how to do that in android, and I got very confused.
So... we have these Canvas that are write-only, and Bitmaps that are read-only? It seems too stupid to be re...
Looking for an example of someone doing a a sprite sheet BLIT with javascript and the HTML 5 Canvas tag.
I've been looking at Processing.js a bit, but I haven't found a clear cut example of how to do it there.
...
I have subclassed View and do some bitmap drawing inside of the onDraw method. This view is then placed in a horizontal scrollview. Some of the time the bitmaps will not be visible since they are scrolled off screen. To improve performance I would like to avoid drawing anything when the object will not be visible.
So the question is, ho...