Board index » cppbuilder » How best to render GDI graphics in BCB

How best to render GDI graphics in BCB

I want to render an orthogonal scene of ~10,000 wireframe polygons. The
objects in the scene are relatively static, the user can scroll around, zoom
in + out, and drag and drop items.  I have it working fine in OpenGL but
it's not ideal:  1) GL gets messy with multiple viewports, I want unlimited
windows 2) I'm not really using GL's matrix transformations, my processing
is mostly pixel manipulation which GL doesn't handle well.

Can I make my app faster and more flexible by porting to GDI?  What would be
the best tool to use?  As a quick test I wrote a window which rendered the
same scene using TCanvas and TPen, I expected it to be much quicker than GL
but it was actually much slower.  I also tried rendering the whole scene
into an off-screen bitmap, and pasting subsets of the bitmap into the form
depending on scrolling/zoom, this didn't work - in order to get decent
resolution I'd need a bitmap which is way too big to store in memory.

TIA,
Eric

 

Re:How best to render GDI graphics in BCB


Hi, I've used OpenGL a fair bit and GDI functions, and I think you might be hard
pressed to beat the OpenGL performance.

There are many problems lurking in the GDI, some which may be driver -related,
ugh, which crop up when you push the boundaries, as you are, with large bitmaps
etc.

Quote
Eric wrote:
> I want to render an orthogonal scene of ~10,000 wireframe polygons. The
> objects in the scene are relatively static, the user can scroll around, zoom
> in + out, and drag and drop items.  I have it working fine in OpenGL but
> it's not ideal:  1) GL gets messy with multiple viewports, I want unlimited
> windows 2) I'm not really using GL's matrix transformations, my processing
> is mostly pixel manipulation which GL doesn't handle well.

> Can I make my app faster and more flexible by porting to GDI?  What would be
> the best tool to use?  As a quick test I wrote a window which rendered the
> same scene using TCanvas and TPen, I expected it to be much quicker than GL
> but it was actually much slower.  I also tried rendering the whole scene
> into an off-screen bitmap, and pasting subsets of the bitmap into the form
> depending on scrolling/zoom, this didn't work - in order to get decent
> resolution I'd need a bitmap which is way too big to store in memory.

> TIA,
> Eric

  patrickmmartin.vcf
< 1K Download

Re:How best to render GDI graphics in BCB


GDI will not surpass OpenGL, becuase OpenGL has it's own drwing things,
independant from GDI that work much faster (may be becuase they are written
for OpenGL purposes and not common ones, however may be because that jsut
GDI was written by Microsoft:)   ).
Try to set up OpenGL to use GDI to output graphics and you will see that
with GDI the perfomence will be much slower and messier (as more objects, so
slower).
Quote
Patrick Martin <patrickmmar...@freenet.co.uk> wrote in message

news:396C4D2F.715C0D61@freenet.co.uk...
Quote
> Hi, I've used OpenGL a fair bit and GDI functions, and I think you might
be hard
> pressed to beat the OpenGL performance.

> There are many problems lurking in the GDI, some which may be
driver -related,
> ugh, which crop up when you push the boundaries, as you are, with large
bitmaps
> etc.

> Eric wrote:

> > I want to render an orthogonal scene of ~10,000 wireframe polygons. The
> > objects in the scene are relatively static, the user can scroll around,
zoom
> > in + out, and drag and drop items.  I have it working fine in OpenGL but
> > it's not ideal:  1) GL gets messy with multiple viewports, I want
unlimited
> > windows 2) I'm not really using GL's matrix transformations, my
processing
> > is mostly pixel manipulation which GL doesn't handle well.

> > Can I make my app faster and more flexible by porting to GDI?  What
would be
> > the best tool to use?  As a quick test I wrote a window which rendered
the
> > same scene using TCanvas and TPen, I expected it to be much quicker than
GL
> > but it was actually much slower.  I also tried rendering the whole scene
> > into an off-screen bitmap, and pasting subsets of the bitmap into the
form
> > depending on scrolling/zoom, this didn't work - in order to get decent
> > resolution I'd need a bitmap which is way too big to store in memory.

> > TIA,
> > Eric

Other Threads