Rookie
Rookie

Reputation: 4144

Rendering image on the screen efficiently with multi-platform support?

I'm making some kind of image viewer/editor program, that would work on all the 3 main platforms.

I know I can't use OpenGL, because this program should work with the crappiest GFX cards available, meaning there may not be OpenGL drivers available.

How does the other programs draw on the screen so fast without using hardware acceleration? (GFX card).

I have used SDL previously to render pixels on the screen, could that be the solution? Or should I implement the image rendering separately for all 3 main systems (Windows,Mac,Linux) ? And if so, which libraries to use for all of those 3 systems?

I won't need any fancy animation, just plain still images, which I may zoom in/out and move with mouse. I don't know how the image moving would work, since that would have to update all the pixels on the screen, which will be very slow, is there any tricks to optimize that? (without hardware acceleration).

For example Paint Shop Pro 7 has very optimized image viewing, I don't think it uses my GPU at all, and it is very fast too, how can I achieve that speed myself?

Upvotes: 0

Views: 2299

Answers (2)

Curtis
Curtis

Reputation: 1602

What I've done to have multi-platform drawing is write an abstraction layer on top of the drawing routines of each platform (Winforms or WPF for windows, Core Graphics for OS X, and Cairo for Linux). It is open source here: https://github.com/picoe/Eto

This is currently in use for a drawing application, which supports animation so it is performant enough for many scenarios: http://picoe.ca/products/pablodraw

One thing that may or may not be to your liking (depending on how you look at it) is that it is written in .NET/C#.

Upvotes: 0

BЈовић
BЈовић

Reputation: 64303

OpenGL works on all three platforms (windows, linux, mac). It's fixed pipeline is supported even on crappiest graphical cards.

Image rendering can be done using textures, and that is supported on every card.

Mouse manipulation has to be done in SDL (or other framework).

If you choose not to use opengl, you can use qt, which is almost platform independent.

Upvotes: 1

Related Questions