Forum > OpenGL
An opengl canvas with signed distance fonts
marcov:
In the past I've dropped hints that I was working on something OpenGL, well, here it is :-)
It is a simple texture with a layered overlay of primitive types (text, rectangles, lines, circles) with pan and zoom, optimized for speed in camera/vision applications. One overlay overlays the picture, one functions as HUD.
The font support is based on signed distance fonts. The test project is not multiplatform (so windows only, win64 should be ok), though many units are relatively platform independent.
http://www.stack.nl/~marcov/standaloneglv3.zip
(exe and source)
Requires Delphi XE3+ or FPC 3.1.1+/Lazarus trunk. FPC3.0 might work, but requires the only recently committed new records-with-methods versions of TPoint(f) and TRect(f), so won't work out of the box
Ocye:
Many thanks for sharing your code. But I wonder that yours as well as many other OpenGL toolkits is based on dglOpenGL instead of TOpenGLContext which is part of the FCL. It adds a lot of unnecessary dependency and incompatibility. For instance, if I want to adopt one your font classes I cannot just add it. I'd rather have to read and understand the code in order to replicate it for my project.
And having a project that is "not multiplatform" contradicts the idea of Freepascal, IMHO.
Please don't read the text as an insulting. To me it's a pity that a lot of work is done for nothing.
marcov:
--- Quote from: Ocye on November 30, 2015, 01:29:32 pm ---Many thanks for sharing your code. But I wonder that yours as well as many other OpenGL toolkits is based on dglOpenGL instead of TOpenGLContext which is part of the FCL.
--- End quote ---
Afaik topenglcontrol is a separate component (in components/) and not part of the LCL, let alone the FCL)
But that doesn't matter, the reason is very visible in the original post, it can be compiled with Delphi, so unnecessary Lazarus components are avoided (besides, the codebase is older than the topenglcontrol component)
--- Quote --- adds a lot of unnecessary dependency and incompatibility. For instance, if I want to adopt one your font classes I cannot just add it. I'd rather have to read and understand the code in order to replicate it for my project.
--- End quote ---
Well, if you think TOpenGLControl is great, port it to Delphi and have it added to dglopengl? If you want to make it universal, make sure it is available everywhere.
--- Quote ---And having a project that is "not multiplatform" contradicts the idea of Freepascal, IMHO.
--- End quote ---
IMHO that is nonsense. The FPC packages and even RTL have many units that are only for one OS (-type). Yes, some common functionality is abstracted, but not all code (and even less, user's) should be multiplatform.
We are not Java with a state-in-a-state abstraction.
(though strictly speaking it quite portable, since many font solutions are based on ported X packages and this one is not)
--- Quote ---Please don't read the text as an insulting. To me it's a pity that a lot of work is done for nothing.
--- End quote ---
IMHO it is a redundant since the original post made the delphi and windows usage clear. You can port it to openglcontrol and other OSes if you like/need that.
I might test multi-OS myself one day for fun, but it is not a priority. I've no interest in openglcontrol, unless it is ported, I think the pascal opengl community is too small to fragment
it unnecessarily over Delphi and FPC.
Ocye:
Okay, if you start from Delphi it makes sense. I didn't touch it after 2.0. Good point to understand why people do things differently.
aradeonas:
Interesting code marcov.
I just talking about OpenGL GUI in MailList and I dont know your system can help it ot not.
Can you explain more or maybe check MailList?
Navigation
[0] Message Index
[#] Next page