blit

opengl slow on texture blit

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...

How do I use SDL to blit an image in multiply mode?

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. ...

Fastest iPhone Blit Routine?

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...

How do I blit a PNG with some transparency onto a surface in Pygame?

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...

Is there any way to "clear" a surface?

Just wondering... Is there any way to clear a surface from anything that has been blitted to it? ...

Pygame: Blitting a moving background creates too much blur.

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...

OpenGL Textures wont work unless made between two pieces of code which isn't what I want.

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...

Fast rgb565 to YUV (or even rgb565 to Y)

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...

Flash: combine two BitmapData objects via max( channel )

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? ...

How to blit() in android?

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...

Sprite-Sheet BLIT with HTML 5 Canvas?

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. ...

How can I determine if I will draw offscreen when doing custom bitmap blitting in a view inside a scrollview in Android

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...