diff --git a/reference/OpenGL/main.cpp b/reference/OpenGL/main.cpp index bbf769177..6f8c2ecd9 100644 --- a/reference/OpenGL/main.cpp +++ b/reference/OpenGL/main.cpp @@ -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(); diff --git a/uppsrc/GLCtrl/Copying b/uppsrc/GLCtrl/Copying new file mode 100644 index 000000000..49801fad5 --- /dev/null +++ b/uppsrc/GLCtrl/Copying @@ -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. \ No newline at end of file diff --git a/uppsrc/GLCtrl/GLCtrl.upp b/uppsrc/GLCtrl/GLCtrl.upp index e2b6336b3..63f9b024d 100644 --- a/uppsrc/GLCtrl/GLCtrl.upp +++ b/uppsrc/GLCtrl/GLCtrl.upp @@ -12,5 +12,8 @@ file GLCtrl.h, Win32GLCtrl.cpp, XGLCtrl.cpp, - GLCtrl.cpp; + GLCtrl.cpp, + Info readonly separator, + src.tpp, + Copying; diff --git a/uppsrc/GLCtrl/src.tpp/GLCtrl_en-us.tpp b/uppsrc/GLCtrl/src.tpp/GLCtrl_en-us.tpp new file mode 100644 index 000000000..0b2be27e8 --- /dev/null +++ b/uppsrc/GLCtrl/src.tpp/GLCtrl_en-us.tpp @@ -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_; ]] \ No newline at end of file