Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Introducing OSVGS
Introducing OSVGS [message #35840] Tue, 27 March 2012 17:48 Go to next message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi,

I have just committed the initial version of OSVGS and OSVGS_Demo in sandbox. OSVGS stands for one-stop-vector-graphics-shop. It is supposed to map a single API efficiently to various graphics backends: Draw, Painter, OpenGL and Direct2D for starters. The main idea is to get graphics dependent application code written once and then having it run on future platforms without changing the code. Just updating the OSVGS.

It could have been called TWR for the-wheel-reinvented too.

Anyone interested, please get it (SVN r.4724 or something) and test it.

- Reading OSVGS/OSVGS.h rapidly explains how it is supposed to work
- Reading OSVGS_Demo/main.cpp explains how to use it
- Reading OSVGS/*.txt explains what is the current status of the project

- Clicking on the OSVGS_Demo window's client area gives some simple benchmarking results.

- Windows 7 (or Vista SP2 +platform update for Direct2D) is required on windows to make it work.

- It should run on Linux too, but I haven't tested it in a couple of days.

- The most important thing missing here is the DrawText functionality for OpenGL implementation. I think it needs a different set of brains for decent results.

Anyway, please report any issues found. Constructive comments are most welcome -- destructive ones less so.

Best regards,

Tom
Re: Introducing OSVGS [message #36430 is a reply to message #35840] Sat, 26 May 2012 23:19 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hi Tom,

I just tried you're demo and it seems quite promissing.
OpenGL drawing is much faster for the drawn example.

The thing that surprises me is that nobody else answered you're post ?!?

The recent posts talking about RGBA and draw vs painter seem to show you're OSVGS philosophy is somewhat needed.

Keep-up
Re: Introducing OSVGS [message #36432 is a reply to message #36430] Sun, 27 May 2012 09:11 Go to previous messageGo to next message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi Didier,

Thanks for your interest. (It is quite unique!)

Anyway, based on the fact that you are the first and only one to reply after two months has already passed, I'm afraid OSVGS is not going to be a "bestseller". Still, I hope this could have some effect on the direction future Upp graphics sub-systems will take.

Thanks and best regards,

Tom
Re: Introducing OSVGS [message #36442 is a reply to message #36432] Sun, 27 May 2012 21:42 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Tom

After renaming the WINXP ifdefs to avoid Direct2D I saw your package running. It seems rather interesting.

PD: It is a little bit slow to start.



Best regards
Iñaki
Re: Introducing OSVGS [message #36446 is a reply to message #36442] Mon, 28 May 2012 09:03 Go to previous messageGo to next message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi Koldo,

The start-up delay is caused by benchmarking the drawing performance each time the display is updated. By clicking the uncovered window area with left mouse button, you can get the performance report of the previous refresh.

The main.cpp for the OSVGS_Demo includes the TEST macro, in which int reps=2000;. Change to reps=1; and it starts reasonably fast. However, the benchmarking will not give proper results then because the timer resolution is not sufficient for such short test periods.

#define TEST(_function_,_result_) { \
	dword begin;\
	dword end;\
	int reps=2000;\
	dword zero=ms_timer;\


Thanks for your interest.

Best regards,

Tom
Re: Introducing OSVGS [message #36450 is a reply to message #36446] Mon, 28 May 2012 11:03 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Tom

One question: Why to create OSVGS instead of creating new Draw subclasses for OpenGL and Direct2D?

Now for example:
class PdfDraw : public Draw 
class Painter : public Draw


Could it be this too?:
class OpenGLDraw : public Draw 
class Direct2DDraw : public Draw


Best regards
Iñaki
Re: Introducing OSVGS [message #36451 is a reply to message #36450] Mon, 28 May 2012 12:06 Go to previous message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi Koldo,

There are some differences between Draw and OSVGS:

- OSVGS uses floating point coordinates whereas Draw uses ints.
- OSVGS supports wide dashed line styles (if available on the underlying platform) whereas Draw does not.
- OSVGS supports anti-aliasing (if available on the underlying platform) whereas Draw does not.

I wrote OSVGS for Draw as an example of mapping the OSVGS API. The real thing should probably be written for Windows GDI and X11 directly (at least in part to support wide dashed line styles).

These differences rise from my personal specific needs. I also wanted to make OSVGS very simple and clear for anybody taking the first look at it, yet include enough features to render typical maps; please see OSVGS.h.

So, yes: It could have been OpenGLDraw : public Draw, ... etc. but that would not have solved my problem: Draw is too limited in a sense, and I'm not in the "inner circle" of U++ which is required to add features to Draw, so I need to work on the "outer ring" instead.

In fact, based on discussions with Mirek in this forum under a different topic a few months ago, I was left with an impression that Draw might be headed to a completely different direction: i.e. obsoleting features instead of adding more features. This was one of the reasons for me to put together this OSVGS thing.

Best regards,

Tom
Previous Topic: Precisions on keyflags value in MouseMove
Next Topic: Chromium embedded in U++
Goto Forum:
  


Current Time: Tue Apr 16 22:39:05 CEST 2024

Total time taken to generate the page: 0.01445 seconds