Doc: added initial documentation for GLCtrl.

This commit is contained in:
Zbigniew Rębacz 2024-01-05 15:01:28 +01:00
parent 08391af03a
commit 9b445afebb
4 changed files with 60 additions and 8 deletions

View file

@ -6,7 +6,7 @@ using namespace Upp;
struct OpenGLExample : GLCtrl {
Point point;
virtual void GLPaint() {
void GLPaint() override {
StdView();
double t = 13 * point.x;
@ -56,11 +56,7 @@ struct OpenGLExample : GLCtrl {
glEnd();
}
virtual void GLResize(int w, int h) {
glViewport(0, 0, (GLsizei)w, (GLsizei)h);
}
virtual void LeftDown(Point, dword)
void LeftDown(Point, dword) override
{ // Demonstrates how to create a screenshot of opengl widget
ExecuteGL([&] {
Size sz=GetSize();
@ -88,7 +84,7 @@ struct OpenGLExample : GLCtrl {
});
}
virtual void MouseMove(Point p, dword) {
void MouseMove(Point p, dword) override {
point = p;
Refresh();
}
@ -100,6 +96,7 @@ GUI_APP_MAIN
TopWindow win;
OpenGLExample gl;
gl.SetFrame(InsetFrame());
win.Title("OpenGL Reference");
win.Add(gl.HSizePos(10, 10).VSizePos(10, 10));
win.Sizeable().Zoomable();
win.Open();

22
uppsrc/GLCtrl/Copying Normal file
View file

@ -0,0 +1,22 @@
Copyright (c) 1998, 2023, The U++ Project
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other materials provided
with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

View file

@ -12,5 +12,8 @@ file
GLCtrl.h,
Win32GLCtrl.cpp,
XGLCtrl.cpp,
GLCtrl.cpp;
GLCtrl.cpp,
Info readonly separator,
src.tpp,
Copying;

View file

@ -0,0 +1,30 @@
topic "GLCtrl";
[i448;a25;kKO9; $$1,0#37138531426314131252341829483380:structitem]
[l288;2 $$2,0#27521748481378242620020725143825:desc]
[0 $$3,0#96390100711032703541132217272105:end]
[H6;0 $$4,0#05600065144404261032431302351956:begin]
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:codeitem]
[ $$0,0#00000000000000000000000000000000:Default]
[{_}
[ {{10000@(113.42.0) [s0; [*@7;4 GLCtrl]]}}&]
[s0;2 &]
[s1;:Upp`:`:GLCtrl: [* GLCtrl] [@(0.0.255) :] [@(0.0.255) public] Ctrl&]
[s0;l288;%% [2 This class is responsible for displaying 3D graphics
via OpenGL. It directly inherits from ][^topic`:`/`/CtrlCore`/src`/Ctrl`_en`-us`#Ctrl`:`:class^2 C
trl][2 class from CtrlCore package.]&]
[s3; &]
[ {{10000F(128)G(128)@1 [s0;%% [* Public Member List]]}}&]
[s0;2 &]
[s5;:Upp`:`:GLCtrl`:`:WhenGLPaint: Callback [* WhenGLPaint]&]
[s2;%% Callback that can be assigned in order to provide custom rendering
instructions.&]
[s3; &]
[s0;2 &]
[ {{10000F(128)G(128)@1 [s0;%% [* Protected Method List]]}}&]
[s3; &]
[s5;:Upp`:`:GLCtrl`:`:GLPaint`(`): [@(0.0.255) virtual void] [* GLPaint]()&]
[s2;%% The method responsible for handling OpenGL rendering. Can
be overridden in child class. If the method is not overridden
it is by default executing [^topic`:`/`/GLCtrl`/src`/GLCtrl`_en`-us`#Upp`:`:GLCtrl`:`:WhenGLPaint^ W
henGLPaint] callback.&]
[s5;i0;O_; ]]