fxruby 1.6.46 → 1.6.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/binary.yml +4 -4
- data/.github/workflows/ci.yml +3 -3
- data/.yardopts +2 -2
- data/Gemfile +1 -1
- data/History.md +6 -0
- data/README.md +2 -2
- data/Rakefile +1 -1
- data/appveyor.yml +1 -1
- data/doap.rdf +1 -1
- data/docs/Fox/Canvas/CanvasError.html +2 -2
- data/docs/Fox/Canvas/CircleShape.html +2 -2
- data/docs/Fox/Canvas/ImageShape.html +2 -2
- data/docs/Fox/Canvas/LineShape.html +2 -2
- data/docs/Fox/Canvas/PolygonShape.html +2 -2
- data/docs/Fox/Canvas/RectangleShape.html +2 -2
- data/docs/Fox/Canvas/SelectionPolicy.html +2 -2
- data/docs/Fox/Canvas/Shape.html +2 -2
- data/docs/Fox/Canvas/ShapeCanvas.html +2 -2
- data/docs/Fox/Canvas/ShapeGroup.html +2 -2
- data/docs/Fox/Canvas/SingleSelectionPolicy.html +2 -2
- data/docs/Fox/Canvas/TextShape.html +2 -2
- data/docs/Fox/Canvas.html +2 -2
- data/docs/Fox/FTNonModal.html +2 -2
- data/docs/Fox/FX4Splitter.html +2 -2
- data/docs/Fox/FX7Segment.html +2 -2
- data/docs/Fox/FXAccelTable.html +2 -2
- data/docs/Fox/FXApp.html +2 -2
- data/docs/Fox/FXArc.html +2 -2
- data/docs/Fox/FXArrowButton.html +2 -2
- data/docs/Fox/FXBMPIcon.html +2 -2
- data/docs/Fox/FXBMPImage.html +2 -2
- data/docs/Fox/FXBitmap.html +2 -2
- data/docs/Fox/FXBitmapFrame.html +2 -2
- data/docs/Fox/FXBitmapView.html +2 -2
- data/docs/Fox/FXButton.html +2 -2
- data/docs/Fox/FXCURCursor.html +2 -2
- data/docs/Fox/FXCalendar.html +2 -2
- data/docs/Fox/FXCanvas.html +2 -2
- data/docs/Fox/FXCheckButton.html +2 -2
- data/docs/Fox/FXChoiceBox.html +2 -2
- data/docs/Fox/FXColor.html +2 -2
- data/docs/Fox/FXColorBar.html +2 -2
- data/docs/Fox/FXColorDialog.html +2 -2
- data/docs/Fox/FXColorItem.html +2 -2
- data/docs/Fox/FXColorList.html +2 -2
- data/docs/Fox/FXColorRing.html +2 -2
- data/docs/Fox/FXColorSelector.html +2 -2
- data/docs/Fox/FXColorWell.html +2 -2
- data/docs/Fox/FXColorWheel.html +2 -2
- data/docs/Fox/FXComboBox.html +2 -2
- data/docs/Fox/FXComboTableItem.html +2 -2
- data/docs/Fox/FXCommand.html +2 -2
- data/docs/Fox/FXComposite.html +2 -2
- data/docs/Fox/FXCursor.html +2 -2
- data/docs/Fox/FXDC.html +2 -2
- data/docs/Fox/FXDCPrint.html +2 -2
- data/docs/Fox/FXDCWindow.html +2 -2
- data/docs/Fox/FXDataTarget.html +2 -2
- data/docs/Fox/FXDebugTarget.html +2 -2
- data/docs/Fox/FXDelegator.html +2 -2
- data/docs/Fox/FXDial.html +2 -2
- data/docs/Fox/FXDialogBox.html +2 -2
- data/docs/Fox/FXDict.html +2 -2
- data/docs/Fox/FXDirBox.html +2 -2
- data/docs/Fox/FXDirDialog.html +2 -2
- data/docs/Fox/FXDirItem.html +2 -2
- data/docs/Fox/FXDirList.html +2 -2
- data/docs/Fox/FXDirSelector.html +2 -2
- data/docs/Fox/FXDockBar.html +2 -2
- data/docs/Fox/FXDockHandler.html +2 -2
- data/docs/Fox/FXDockSite.html +2 -2
- data/docs/Fox/FXDockTitle.html +2 -2
- data/docs/Fox/FXDocument.html +2 -2
- data/docs/Fox/FXDragCorner.html +2 -2
- data/docs/Fox/FXDrawable.html +2 -2
- data/docs/Fox/FXDriveBox.html +2 -2
- data/docs/Fox/FXEvent.html +2 -2
- data/docs/Fox/FXExtentd.html +2 -2
- data/docs/Fox/FXExtentf.html +2 -2
- data/docs/Fox/FXFileAssoc.html +2 -2
- data/docs/Fox/FXFileDialog.html +2 -2
- data/docs/Fox/FXFileDict.html +2 -2
- data/docs/Fox/FXFileItem.html +2 -2
- data/docs/Fox/FXFileList.html +2 -2
- data/docs/Fox/FXFileSelector.html +2 -2
- data/docs/Fox/FXFileStream.html +2 -2
- data/docs/Fox/FXFoldingItem.html +2 -2
- data/docs/Fox/FXFoldingList.html +2 -2
- data/docs/Fox/FXFont.html +2 -2
- data/docs/Fox/FXFontDesc.html +2 -2
- data/docs/Fox/FXFontDialog.html +2 -2
- data/docs/Fox/FXFontSelector.html +2 -2
- data/docs/Fox/FXFrame.html +2 -2
- data/docs/Fox/FXGIFCursor.html +2 -2
- data/docs/Fox/FXGIFIcon.html +2 -2
- data/docs/Fox/FXGIFImage.html +2 -2
- data/docs/Fox/FXGLCanvas.html +2 -2
- data/docs/Fox/FXGLCone.html +53 -60
- data/docs/Fox/FXGLContext.html +2 -2
- data/docs/Fox/FXGLCube.html +72 -78
- data/docs/Fox/FXGLCylinder.html +62 -69
- data/docs/Fox/FXGLGroup.html +57 -58
- data/docs/Fox/FXGLLine.html +44 -50
- data/docs/Fox/FXGLObject.html +2 -2
- data/docs/Fox/FXGLPoint.html +30 -36
- data/docs/Fox/FXGLShape.html +2 -2
- data/docs/Fox/FXGLSphere.html +38 -45
- data/docs/Fox/FXGLViewer.html +2 -2
- data/docs/Fox/FXGLVisual.html +2 -2
- data/docs/Fox/FXGradient.html +2 -2
- data/docs/Fox/FXGradientBar.html +2 -2
- data/docs/Fox/FXGroupBox.html +2 -2
- data/docs/Fox/FXHeader.html +2 -2
- data/docs/Fox/FXHeaderItem.html +2 -2
- data/docs/Fox/FXHiliteStyle.html +2 -2
- data/docs/Fox/FXHorizontalFrame.html +2 -2
- data/docs/Fox/FXHorizontalSeparator.html +2 -2
- data/docs/Fox/FXICOIcon.html +2 -2
- data/docs/Fox/FXICOImage.html +2 -2
- data/docs/Fox/FXIcon.html +2 -2
- data/docs/Fox/FXIconDict.html +2 -2
- data/docs/Fox/FXIconItem.html +2 -2
- data/docs/Fox/FXIconList.html +2 -2
- data/docs/Fox/FXIconSource.html +2 -2
- data/docs/Fox/FXId.html +2 -2
- data/docs/Fox/FXImage.html +2 -2
- data/docs/Fox/FXImageFrame.html +2 -2
- data/docs/Fox/FXImageView.html +2 -2
- data/docs/Fox/FXInputDialog.html +2 -2
- data/docs/Fox/FXIrb.html +2 -2
- data/docs/Fox/FXJPGIcon.html +2 -2
- data/docs/Fox/FXJPGImage.html +2 -2
- data/docs/Fox/FXKnob.html +2 -2
- data/docs/Fox/FXLabel.html +2 -2
- data/docs/Fox/FXLight.html +2 -2
- data/docs/Fox/FXList.html +2 -2
- data/docs/Fox/FXListBox.html +2 -2
- data/docs/Fox/FXListItem.html +2 -2
- data/docs/Fox/FXMDIChild.html +2 -2
- data/docs/Fox/FXMDIClient.html +2 -2
- data/docs/Fox/FXMDIDeleteButton.html +2 -2
- data/docs/Fox/FXMDIMaximizeButton.html +2 -2
- data/docs/Fox/FXMDIMenu.html +2 -2
- data/docs/Fox/FXMDIMinimizeButton.html +2 -2
- data/docs/Fox/FXMDIRestoreButton.html +2 -2
- data/docs/Fox/FXMDIWindowButton.html +2 -2
- data/docs/Fox/FXMainWindow.html +2 -2
- data/docs/Fox/FXMaterial.html +2 -2
- data/docs/Fox/FXMatrix.html +2 -2
- data/docs/Fox/FXMemoryBuffer.html +2 -2
- data/docs/Fox/FXMemoryStream.html +2 -2
- data/docs/Fox/FXMenuBar.html +2 -2
- data/docs/Fox/FXMenuButton.html +2 -2
- data/docs/Fox/FXMenuCaption.html +2 -2
- data/docs/Fox/FXMenuCascade.html +2 -2
- data/docs/Fox/FXMenuCheck.html +2 -2
- data/docs/Fox/FXMenuCommand.html +2 -2
- data/docs/Fox/FXMenuPane.html +2 -2
- data/docs/Fox/FXMenuRadio.html +2 -2
- data/docs/Fox/FXMenuSeparator.html +2 -2
- data/docs/Fox/FXMenuTitle.html +2 -2
- data/docs/Fox/FXMessageBox.html +2 -2
- data/docs/Fox/FXObject.html +2 -2
- data/docs/Fox/FXOption.html +2 -2
- data/docs/Fox/FXOptionMenu.html +2 -2
- data/docs/Fox/FXPCXIcon.html +2 -2
- data/docs/Fox/FXPCXImage.html +2 -2
- data/docs/Fox/FXPNGIcon.html +2 -2
- data/docs/Fox/FXPNGImage.html +2 -2
- data/docs/Fox/FXPPMIcon.html +2 -2
- data/docs/Fox/FXPPMImage.html +2 -2
- data/docs/Fox/FXPSBounds.html +2 -2
- data/docs/Fox/FXPacker.html +2 -2
- data/docs/Fox/FXPicker.html +2 -2
- data/docs/Fox/FXPopup.html +2 -2
- data/docs/Fox/FXPrintDialog.html +2 -2
- data/docs/Fox/FXPrinter.html +2 -2
- data/docs/Fox/FXProgressBar.html +2 -2
- data/docs/Fox/FXProgressDialog.html +2 -2
- data/docs/Fox/FXPseudoKeyboard.html +2 -2
- data/docs/Fox/FXPseudoMouse.html +2 -2
- data/docs/Fox/FXPseudoTarget.html +2 -2
- data/docs/Fox/FXQuatd.html +2 -2
- data/docs/Fox/FXQuatf.html +2 -2
- data/docs/Fox/FXRGBIcon.html +2 -2
- data/docs/Fox/FXRGBImage.html +2 -2
- data/docs/Fox/FXRadioButton.html +2 -2
- data/docs/Fox/FXRanged.html +2 -2
- data/docs/Fox/FXRangef.html +2 -2
- data/docs/Fox/FXRealSlider.html +2 -2
- data/docs/Fox/FXRealSpinner.html +2 -2
- data/docs/Fox/FXRecentFiles.html +2 -2
- data/docs/Fox/FXRectangle.html +2 -2
- data/docs/Fox/FXRegion.html +2 -2
- data/docs/Fox/FXRegistry.html +2 -2
- data/docs/Fox/FXReplaceDialog.html +2 -2
- data/docs/Fox/FXRootWindow.html +2 -2
- data/docs/Fox/FXRuler.html +2 -2
- data/docs/Fox/FXRulerView.html +2 -2
- data/docs/Fox/FXScintilla.html +2 -2
- data/docs/Fox/FXScrollArea.html +2 -2
- data/docs/Fox/FXScrollBar.html +2 -2
- data/docs/Fox/FXScrollCorner.html +2 -2
- data/docs/Fox/FXScrollPane.html +2 -2
- data/docs/Fox/FXScrollWindow.html +2 -2
- data/docs/Fox/FXSearchDialog.html +2 -2
- data/docs/Fox/FXSegment.html +2 -2
- data/docs/Fox/FXSeparator.html +2 -2
- data/docs/Fox/FXSettings.html +2 -2
- data/docs/Fox/FXShell.html +2 -2
- data/docs/Fox/FXShutter.html +2 -2
- data/docs/Fox/FXShutterItem.html +2 -2
- data/docs/Fox/FXSize.html +2 -2
- data/docs/Fox/FXSlider.html +2 -2
- data/docs/Fox/FXSphered.html +2 -2
- data/docs/Fox/FXSpheref.html +2 -2
- data/docs/Fox/FXSpinner.html +2 -2
- data/docs/Fox/FXSplashScreen.html +2 -2
- data/docs/Fox/FXSplashWindow.html +2 -2
- data/docs/Fox/FXSplitter.html +2 -2
- data/docs/Fox/FXSpring.html +2 -2
- data/docs/Fox/FXStatusBar.html +2 -2
- data/docs/Fox/FXStatusLine.html +2 -2
- data/docs/Fox/FXStream.html +2 -2
- data/docs/Fox/FXStreamAllocError.html +2 -2
- data/docs/Fox/FXStreamEndError.html +2 -2
- data/docs/Fox/FXStreamError.html +2 -2
- data/docs/Fox/FXStreamFailureError.html +2 -2
- data/docs/Fox/FXStreamFormatError.html +2 -2
- data/docs/Fox/FXStreamFullError.html +2 -2
- data/docs/Fox/FXStreamNoReadError.html +2 -2
- data/docs/Fox/FXStreamNoWriteError.html +2 -2
- data/docs/Fox/FXStreamUnknownError.html +2 -2
- data/docs/Fox/FXStringDict.html +2 -2
- data/docs/Fox/FXSwitcher.html +2 -2
- data/docs/Fox/FXTGAIcon.html +2 -2
- data/docs/Fox/FXTGAImage.html +2 -2
- data/docs/Fox/FXTIFIcon.html +2 -2
- data/docs/Fox/FXTIFImage.html +2 -2
- data/docs/Fox/FXTabBar.html +2 -2
- data/docs/Fox/FXTabBook.html +2 -2
- data/docs/Fox/FXTabItem.html +2 -2
- data/docs/Fox/FXTable.html +2 -2
- data/docs/Fox/FXTableItem.html +2 -2
- data/docs/Fox/FXTablePos.html +2 -2
- data/docs/Fox/FXTableRange.html +2 -2
- data/docs/Fox/FXText.html +2 -2
- data/docs/Fox/FXTextChange.html +2 -2
- data/docs/Fox/FXTextField.html +2 -2
- data/docs/Fox/FXToggleButton.html +2 -2
- data/docs/Fox/FXToolBar.html +2 -2
- data/docs/Fox/FXToolBarGrip.html +2 -2
- data/docs/Fox/FXToolBarShell.html +2 -2
- data/docs/Fox/FXToolBarTab.html +2 -2
- data/docs/Fox/FXToolTip.html +2 -2
- data/docs/Fox/FXTopWindow.html +2 -2
- data/docs/Fox/FXTranslator.html +2 -2
- data/docs/Fox/FXTreeItem.html +2 -2
- data/docs/Fox/FXTreeList.html +2 -2
- data/docs/Fox/FXTreeListBox.html +2 -2
- data/docs/Fox/FXTriStateButton.html +2 -2
- data/docs/Fox/FXUndoList.html +2 -2
- data/docs/Fox/FXVec2d.html +2 -2
- data/docs/Fox/FXVec2f.html +2 -2
- data/docs/Fox/FXVec3d.html +2 -2
- data/docs/Fox/FXVec3f.html +2 -2
- data/docs/Fox/FXVec4d.html +2 -2
- data/docs/Fox/FXVec4f.html +2 -2
- data/docs/Fox/FXVerticalFrame.html +2 -2
- data/docs/Fox/FXVerticalSeparator.html +2 -2
- data/docs/Fox/FXViewport.html +2 -2
- data/docs/Fox/FXVisual.html +2 -2
- data/docs/Fox/FXWindow.html +2 -2
- data/docs/Fox/FXWizard.html +2 -2
- data/docs/Fox/FXXBMIcon.html +2 -2
- data/docs/Fox/FXXBMImage.html +2 -2
- data/docs/Fox/FXXPMIcon.html +2 -2
- data/docs/Fox/FXXPMImage.html +2 -2
- data/docs/Fox/NotifyHeader.html +2 -2
- data/docs/Fox/SCNotification.html +2 -2
- data/docs/Fox/TextRange.html +2 -2
- data/docs/Fox.html +3 -3
- data/docs/IRB.html +2 -2
- data/docs/Responder.html +2 -2
- data/docs/Responder2.html +2 -2
- data/docs/_index.html +2 -2
- data/docs/file.History.html +11 -2
- data/docs/file.README.html +2 -2
- data/docs/index.html +481 -501
- data/docs/top-level-namespace.html +2 -2
- data/examples/gltest.rb +104 -105
- data/examples/glviewer.rb +3 -3
- data/ext/fox16_c/extconf.rb +5 -5
- data/fxruby.gemspec +2 -2
- data/lib/fox16/glgroup.rb +3 -4
- data/lib/fox16/glshapes.rb +85 -100
- data/lib/fox16/version.rb +1 -1
- data/scripts/iface.rb +8 -12
- data.tar.gz.sig +0 -0
- metadata +28 -32
- metadata.gz.sig +0 -0
- data/rdoc-sources/Makefile +0 -23
|
@@ -204,9 +204,9 @@
|
|
|
204
204
|
</div>
|
|
205
205
|
|
|
206
206
|
<div id="footer">
|
|
207
|
-
Generated on
|
|
207
|
+
Generated on Sun May 14 21:55:15 2023 by
|
|
208
208
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
209
|
-
0.9.
|
|
209
|
+
0.9.34 (ruby-3.2.0).
|
|
210
210
|
</div>
|
|
211
211
|
|
|
212
212
|
</div>
|
data/examples/gltest.rb
CHANGED
|
@@ -6,8 +6,8 @@ begin
|
|
|
6
6
|
rescue LoadError
|
|
7
7
|
require 'fox16/missingdep'
|
|
8
8
|
MSG = <<EOM
|
|
9
|
-
Sorry, this example depends on the opengl-
|
|
10
|
-
gem install opengl-
|
|
9
|
+
Sorry, this example depends on the opengl-bindings2 gems. Please execute:
|
|
10
|
+
gem install opengl-bindings2
|
|
11
11
|
EOM
|
|
12
12
|
missingDependency(MSG)
|
|
13
13
|
end
|
|
@@ -16,67 +16,66 @@ end
|
|
|
16
16
|
|
|
17
17
|
class GLTestWindow < Fox::FXMainWindow
|
|
18
18
|
include Fox
|
|
19
|
-
include OpenGL
|
|
20
19
|
|
|
21
20
|
# How often our timer will fire (in milliseconds)
|
|
22
21
|
TIMER_INTERVAL = 100
|
|
23
22
|
|
|
24
23
|
# Draws a simple box using the given corners
|
|
25
24
|
def drawBox(xmin, ymin, zmin, xmax, ymax, zmax)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
25
|
+
GL.Begin(GL::TRIANGLE_STRIP)
|
|
26
|
+
GL.Normal3d(0.0, 0.0, -1.0)
|
|
27
|
+
GL.Vertex3d(xmin, ymin, zmin)
|
|
28
|
+
GL.Vertex3d(xmin, ymax, zmin)
|
|
29
|
+
GL.Vertex3d(xmax, ymin, zmin)
|
|
30
|
+
GL.Vertex3d(xmax, ymax, zmin)
|
|
31
|
+
GL.End()
|
|
32
|
+
|
|
33
|
+
GL.Begin(GL::TRIANGLE_STRIP)
|
|
34
|
+
GL.Normal3d(1.0, 0.0, 0.0)
|
|
35
|
+
GL.Vertex3d(xmax, ymin, zmin)
|
|
36
|
+
GL.Vertex3d(xmax, ymax, zmin)
|
|
37
|
+
GL.Vertex3d(xmax, ymin, zmax)
|
|
38
|
+
GL.Vertex3d(xmax, ymax, zmax)
|
|
39
|
+
GL.End()
|
|
40
|
+
|
|
41
|
+
GL.Begin(GL::TRIANGLE_STRIP)
|
|
42
|
+
GL.Normal3d(0.0, 0.0, 1.0)
|
|
43
|
+
GL.Vertex3d(xmax, ymin, zmax)
|
|
44
|
+
GL.Vertex3d(xmax, ymax, zmax)
|
|
45
|
+
GL.Vertex3d(xmin, ymin, zmax)
|
|
46
|
+
GL.Vertex3d(xmin, ymax, zmax)
|
|
47
|
+
GL.End()
|
|
48
|
+
|
|
49
|
+
GL.Begin(GL::TRIANGLE_STRIP)
|
|
50
|
+
GL.Normal3d(-1.0, 0.0, 0.0)
|
|
51
|
+
GL.Vertex3d(xmin, ymin, zmax)
|
|
52
|
+
GL.Vertex3d(xmin, ymax, zmax)
|
|
53
|
+
GL.Vertex3d(xmin, ymin, zmin)
|
|
54
|
+
GL.Vertex3d(xmin, ymax, zmin)
|
|
55
|
+
GL.End()
|
|
56
|
+
|
|
57
|
+
GL.Begin(GL::TRIANGLE_STRIP)
|
|
58
|
+
GL.Normal3d(0.0, 1.0, 0.0)
|
|
59
|
+
GL.Vertex3d(xmin, ymax, zmin)
|
|
60
|
+
GL.Vertex3d(xmin, ymax, zmax)
|
|
61
|
+
GL.Vertex3d(xmax, ymax, zmin)
|
|
62
|
+
GL.Vertex3d(xmax, ymax, zmax)
|
|
63
|
+
GL.End()
|
|
64
|
+
|
|
65
|
+
GL.Begin(GL::TRIANGLE_STRIP)
|
|
66
|
+
GL.Normal3d(0.0, -1.0, 0.0)
|
|
67
|
+
GL.Vertex3d(xmax, ymin, zmax)
|
|
68
|
+
GL.Vertex3d(xmax, ymin, zmin)
|
|
69
|
+
GL.Vertex3d(xmin, ymin, zmax)
|
|
70
|
+
GL.Vertex3d(xmin, ymin, zmin)
|
|
71
|
+
GL.End()
|
|
73
72
|
end
|
|
74
73
|
|
|
75
74
|
def gluPerspective(fovY, aspect, zNear, zFar )
|
|
76
75
|
fH = Math.tan( fovY / 360 * Math::PI ) * zNear;
|
|
77
76
|
fW = fH * aspect;
|
|
78
77
|
|
|
79
|
-
|
|
78
|
+
GL.Frustum( -fW, fW, -fH, fH, zNear, zFar );
|
|
80
79
|
end
|
|
81
80
|
|
|
82
81
|
# Define our own version of gluLookAt() to avoid dependency to deprecated GLU library
|
|
@@ -122,8 +121,8 @@ class GLTestWindow < Fox::FXMainWindow
|
|
|
122
121
|
x2,y2,z2,0,
|
|
123
122
|
0, 0, 0,1,
|
|
124
123
|
].pack("d*")
|
|
125
|
-
|
|
126
|
-
|
|
124
|
+
GL.MultMatrixd m4x4
|
|
125
|
+
GL.Translated -ex,-ey,-ez
|
|
127
126
|
end
|
|
128
127
|
|
|
129
128
|
# Draw the GL scene
|
|
@@ -141,80 +140,80 @@ class GLTestWindow < Fox::FXMainWindow
|
|
|
141
140
|
# Make context current
|
|
142
141
|
@glcanvas.makeCurrent()
|
|
143
142
|
|
|
144
|
-
|
|
143
|
+
GL.Viewport(0, 0, @glcanvas.width, @glcanvas.height)
|
|
145
144
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
GL.ClearColor(1.0, 1.0, 1.0, 1.0)
|
|
146
|
+
GL.Clear(GL::COLOR_BUFFER_BIT|GL::DEPTH_BUFFER_BIT)
|
|
147
|
+
GL.Enable(GL::DEPTH_TEST)
|
|
149
148
|
|
|
150
|
-
|
|
149
|
+
GL.Disable(GL::DITHER)
|
|
151
150
|
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
GL.MatrixMode(GL::PROJECTION)
|
|
152
|
+
GL.LoadIdentity()
|
|
154
153
|
gluPerspective(30.0, aspect, 1.0, 100.0)
|
|
155
154
|
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
GL.MatrixMode(GL::MODELVIEW)
|
|
156
|
+
GL.LoadIdentity()
|
|
158
157
|
gluLookAt(5.0, 10.0, 15.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)
|
|
159
158
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
159
|
+
GL.ShadeModel(GL::SMOOTH)
|
|
160
|
+
GL.Lightfv(GL::LIGHT0, GL::POSITION, lightPosition.pack("f*"))
|
|
161
|
+
GL.Lightfv(GL::LIGHT0, GL::AMBIENT, lightAmbient.pack("f*"))
|
|
162
|
+
GL.Lightfv(GL::LIGHT0, GL::DIFFUSE, lightDiffuse.pack("f*"))
|
|
163
|
+
GL.Enable(GL::LIGHT0)
|
|
164
|
+
GL.Enable(GL::LIGHTING)
|
|
166
165
|
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
GL.Materialfv(GL::FRONT, GL::AMBIENT, blueMaterial.pack("f*"))
|
|
167
|
+
GL.Materialfv(GL::FRONT, GL::DIFFUSE, blueMaterial.pack("f*"))
|
|
169
168
|
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
GL.PushMatrix()
|
|
170
|
+
GL.Rotated(@angle, 0.0, 1.0, 0.0)
|
|
172
171
|
drawBox(-1, -1, -1, 1, 1, 1)
|
|
173
172
|
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
GL.Materialfv(GL::FRONT, GL::AMBIENT, redMaterial.pack("f*"))
|
|
174
|
+
GL.Materialfv(GL::FRONT, GL::DIFFUSE, redMaterial.pack("f*"))
|
|
176
175
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
176
|
+
GL.PushMatrix()
|
|
177
|
+
GL.Translated(0.0, 1.75, 0.0)
|
|
178
|
+
GL.Rotated(@angle, 0.0, 1.0, 0.0)
|
|
180
179
|
drawBox(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5)
|
|
181
|
-
|
|
180
|
+
GL.PopMatrix()
|
|
182
181
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
GL.PushMatrix()
|
|
183
|
+
GL.Translated(0.0, -1.75, 0.0)
|
|
184
|
+
GL.Rotated(@angle, 0.0, 1.0, 0.0)
|
|
186
185
|
drawBox(-0.5, -0.5, -0.5, 0.5, 0.5, 0.5)
|
|
187
|
-
|
|
186
|
+
GL.PopMatrix()
|
|
188
187
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
188
|
+
GL.PushMatrix()
|
|
189
|
+
GL.Rotated(90.0, 1.0, 0.0, 0.0)
|
|
190
|
+
GL.Translated(0.0, 1.75, 0.0)
|
|
191
|
+
GL.Rotated(@angle, 0.0, 1.0, 0.0)
|
|
193
192
|
drawBox(-0.5,-0.5,-0.5,0.5,0.5,0.5)
|
|
194
|
-
|
|
193
|
+
GL.PopMatrix()
|
|
195
194
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
195
|
+
GL.PushMatrix()
|
|
196
|
+
GL.Rotated(90.0, -1.0, 0.0, 0.0)
|
|
197
|
+
GL.Translated(0.0,1.75,0.0)
|
|
198
|
+
GL.Rotated(@angle, 0.0, 1.0, 0.0)
|
|
200
199
|
drawBox(-0.5,-0.5,-0.5,0.5,0.5,0.5)
|
|
201
|
-
|
|
200
|
+
GL.PopMatrix()
|
|
202
201
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
202
|
+
GL.PushMatrix()
|
|
203
|
+
GL.Rotated(90.0, 0.0, 0.0, 1.0)
|
|
204
|
+
GL.Translated(0.0,1.75,0.0)
|
|
205
|
+
GL.Rotated(@angle, 0.0, 1.0, 0.0)
|
|
207
206
|
drawBox(-0.5,-0.5,-0.5,0.5,0.5,0.5)
|
|
208
|
-
|
|
207
|
+
GL.PopMatrix()
|
|
209
208
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
209
|
+
GL.PushMatrix()
|
|
210
|
+
GL.Rotated(90.0, 0.0, 0.0, -1.0)
|
|
211
|
+
GL.Translated(0.0,1.75,0.0)
|
|
212
|
+
GL.Rotated(@angle, 0.0, 1.0, 0.0)
|
|
214
213
|
drawBox(-0.5,-0.5,-0.5,0.5,0.5,0.5)
|
|
215
|
-
|
|
214
|
+
GL.PopMatrix()
|
|
216
215
|
|
|
217
|
-
|
|
216
|
+
GL.PopMatrix()
|
|
218
217
|
|
|
219
218
|
# Swap if it is double-buffered
|
|
220
219
|
if @glvisual.isDoubleBuffer
|
|
@@ -229,7 +228,7 @@ class GLTestWindow < Fox::FXMainWindow
|
|
|
229
228
|
# Invoke the base class initializer
|
|
230
229
|
super(app, "OpenGL Test Application", :opts => DECOR_ALL, :width => 800, :height => 600)
|
|
231
230
|
|
|
232
|
-
|
|
231
|
+
GL.load_lib
|
|
233
232
|
|
|
234
233
|
# Construct the main window elements
|
|
235
234
|
frame = FXHorizontalFrame.new(self, LAYOUT_SIDE_TOP|LAYOUT_FILL_X|LAYOUT_FILL_Y)
|
|
@@ -263,7 +262,7 @@ class GLTestWindow < Fox::FXMainWindow
|
|
|
263
262
|
@glcanvas.connect(SEL_PAINT) { drawScene }
|
|
264
263
|
@glcanvas.connect(SEL_CONFIGURE) do
|
|
265
264
|
if @glcanvas.makeCurrent
|
|
266
|
-
|
|
265
|
+
GL.Viewport(0, 0, @glcanvas.width, @glcanvas.height)
|
|
267
266
|
@glcanvas.makeNonCurrent
|
|
268
267
|
end
|
|
269
268
|
end
|
data/examples/glviewer.rb
CHANGED
|
@@ -7,8 +7,8 @@ begin
|
|
|
7
7
|
rescue LoadError
|
|
8
8
|
require 'fox16/missingdep'
|
|
9
9
|
MSG = <<EOM
|
|
10
|
-
Sorry, this example depends on the opengl-
|
|
11
|
-
gem install opengl-
|
|
10
|
+
Sorry, this example depends on the opengl-bindings2 gems. Please execute:
|
|
11
|
+
gem install opengl-bindings2
|
|
12
12
|
EOM
|
|
13
13
|
missingDependency(MSG)
|
|
14
14
|
end
|
|
@@ -161,7 +161,7 @@ class GLViewWindow < Fox::FXMainWindow
|
|
|
161
161
|
# Initialize base class first
|
|
162
162
|
super(app, "OpenGL Example Application", :opts => DECOR_ALL, :width => 800, :height => 600)
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
GL.load_lib
|
|
165
165
|
GLU.load_lib
|
|
166
166
|
|
|
167
167
|
# Define message identifiers for this class
|
data/ext/fox16_c/extconf.rb
CHANGED
|
@@ -20,20 +20,20 @@ def fxscintilla_support_suppressed?
|
|
|
20
20
|
!with_config("fxscintilla", true)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
LIBZ_VERSION = ENV['LIBZ_VERSION'] || '1.
|
|
23
|
+
LIBZ_VERSION = ENV['LIBZ_VERSION'] || '1.3.1'
|
|
24
24
|
LIBZ_SOURCE_URI = "http://zlib.net/fossils/zlib-#{LIBZ_VERSION}.tar.gz"
|
|
25
25
|
|
|
26
|
-
LIBPNG_VERSION = ENV['LIBPNG_VERSION'] || '1.6.
|
|
26
|
+
LIBPNG_VERSION = ENV['LIBPNG_VERSION'] || '1.6.42'
|
|
27
27
|
# LIBPNG_SOURCE_URI = "http://prdownloads.sourceforge.net/libpng/libpng-#{LIBPNG_VERSION}.tar.gz"
|
|
28
28
|
LIBPNG_SOURCE_URI = "https://netcologne.dl.sourceforge.net/project/libpng/libpng16/#{LIBPNG_VERSION}/libpng-#{LIBPNG_VERSION}.tar.xz"
|
|
29
29
|
|
|
30
30
|
# LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '9b'
|
|
31
31
|
# LIBJPEG_SOURCE_URI = "http://www.ijg.org/files/jpegsrc.v#{LIBJPEG_VERSION}.tar.gz"
|
|
32
32
|
|
|
33
|
-
LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '
|
|
34
|
-
LIBJPEG_SOURCE_URI = "https://
|
|
33
|
+
LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '3.0.2'
|
|
34
|
+
LIBJPEG_SOURCE_URI = "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/#{LIBJPEG_VERSION}/libjpeg-turbo-#{LIBJPEG_VERSION}.tar.gz"
|
|
35
35
|
|
|
36
|
-
LIBTIFF_VERSION = ENV['LIBTIFF_VERSION'] || '4.
|
|
36
|
+
LIBTIFF_VERSION = ENV['LIBTIFF_VERSION'] || '4.6.0'
|
|
37
37
|
LIBTIFF_SOURCE_URI = "http://download.osgeo.org/libtiff/tiff-#{LIBTIFF_VERSION}.tar.gz"
|
|
38
38
|
|
|
39
39
|
LIBFOX_VERSION = ENV['LIBFOX_VERSION'] || '1.6.57'
|
data/fxruby.gemspec
CHANGED
|
@@ -50,12 +50,12 @@ Gem::Specification.new do |spec|
|
|
|
50
50
|
spec.require_paths = ["lib"]
|
|
51
51
|
spec.extensions = ["ext/fox16_c/extconf.rb"]
|
|
52
52
|
spec.metadata['msys2_mingw_dependencies'] = 'fox'
|
|
53
|
-
spec.required_ruby_version = [">= 2.
|
|
53
|
+
spec.required_ruby_version = [">= 2.6", "< 4"]
|
|
54
54
|
|
|
55
55
|
spec.add_runtime_dependency 'mini_portile2', '~> 2.1'
|
|
56
56
|
|
|
57
57
|
yardopts = File.read(".yardopts")
|
|
58
|
-
spec.rdoc_options = ["--main", "README.
|
|
58
|
+
spec.rdoc_options = ["--main", "README.md",
|
|
59
59
|
"--title", "FXRuby API Documentation"]
|
|
60
60
|
docfiles = yardopts.lines.map(&:strip).select{|r| r=~/^[^-]/ }
|
|
61
61
|
spec.extra_rdoc_files = `git ls-files -z #{docfiles.join(" ")}`.split("\x0")
|
data/lib/fox16/glgroup.rb
CHANGED
|
@@ -9,7 +9,6 @@ module Fox
|
|
|
9
9
|
# A group of OpenGL objects
|
|
10
10
|
#
|
|
11
11
|
class FXGLGroup < FXGLObject
|
|
12
|
-
include OpenGL if defined?(OpenGL)
|
|
13
12
|
include Enumerable
|
|
14
13
|
|
|
15
14
|
FLT_MAX = 1.0e+20
|
|
@@ -80,12 +79,12 @@ module Fox
|
|
|
80
79
|
#
|
|
81
80
|
def hit(viewer)
|
|
82
81
|
# GL.PushName(0xffffffff)
|
|
83
|
-
|
|
82
|
+
GL.PushName(1000000)
|
|
84
83
|
@list.each_with_index do |obj, i|
|
|
85
|
-
|
|
84
|
+
GL.LoadName(i)
|
|
86
85
|
obj.hit(viewer)
|
|
87
86
|
end
|
|
88
|
-
|
|
87
|
+
GL.PopName
|
|
89
88
|
end
|
|
90
89
|
|
|
91
90
|
#
|
data/lib/fox16/glshapes.rb
CHANGED
|
@@ -9,8 +9,6 @@ module Fox
|
|
|
9
9
|
# OpenGL point object
|
|
10
10
|
#
|
|
11
11
|
class FXGLPoint < FXGLObject
|
|
12
|
-
include OpenGL
|
|
13
|
-
|
|
14
12
|
# Point position, in model coordinates (a 3-element array)
|
|
15
13
|
attr_accessor :pos
|
|
16
14
|
|
|
@@ -48,20 +46,20 @@ module Fox
|
|
|
48
46
|
# Draw this point into _viewer_ (an FXGLViewer instance).
|
|
49
47
|
#
|
|
50
48
|
def draw(viewer)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
GL.Color3d(0.0, 0.0, 1.0)
|
|
50
|
+
GL.PointSize(HANDLE_SIZE)
|
|
51
|
+
GL.Begin(GL::POINTS)
|
|
52
|
+
GL.Vertex3d(*@pos)
|
|
53
|
+
GL.End()
|
|
56
54
|
end
|
|
57
55
|
|
|
58
56
|
#
|
|
59
57
|
# Perform hit test for this point in _viewer_ (an FXGLViewer instance).
|
|
60
58
|
#
|
|
61
59
|
def hit(viewer)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
GL.Begin(GL::POINTS)
|
|
61
|
+
GL.Vertex3d(*@pos)
|
|
62
|
+
GL.End()
|
|
65
63
|
end
|
|
66
64
|
end
|
|
67
65
|
|
|
@@ -69,8 +67,6 @@ module Fox
|
|
|
69
67
|
# OpenGL line object
|
|
70
68
|
#
|
|
71
69
|
class FXGLLine < FXGLObject
|
|
72
|
-
include OpenGL
|
|
73
|
-
|
|
74
70
|
# Starting point for line [FXGLPoint]
|
|
75
71
|
attr_accessor :fm
|
|
76
72
|
|
|
@@ -122,22 +118,22 @@ module Fox
|
|
|
122
118
|
# Draw this line into _viewer_ (an FXGLViewer instance).
|
|
123
119
|
#
|
|
124
120
|
def draw(viewer)
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
121
|
+
GL.Color3d(1.0, 0.0, 0.0)
|
|
122
|
+
GL.PointSize(HANDLE_SIZE)
|
|
123
|
+
GL.Begin(GL::LINES)
|
|
124
|
+
GL.Vertex3d(*@fm.pos)
|
|
125
|
+
GL.Vertex3d(*@to.pos)
|
|
126
|
+
GL.End()
|
|
131
127
|
end
|
|
132
128
|
|
|
133
129
|
#
|
|
134
130
|
# Perform hit-test for this line in _viewer_ (an FXGLViewer instance).
|
|
135
131
|
#
|
|
136
132
|
def hit(viewer)
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
133
|
+
GL.Begin(GL::LINES)
|
|
134
|
+
GL.Vertex3d(*@fm.pos)
|
|
135
|
+
GL.Vertex3d(*@to.pos)
|
|
136
|
+
GL.End()
|
|
141
137
|
end
|
|
142
138
|
end
|
|
143
139
|
|
|
@@ -145,8 +141,6 @@ module Fox
|
|
|
145
141
|
# OpenGL cube object
|
|
146
142
|
#
|
|
147
143
|
class FXGLCube < FXGLShape
|
|
148
|
-
include OpenGL
|
|
149
|
-
|
|
150
144
|
# Cube width [Float]
|
|
151
145
|
attr_accessor :width
|
|
152
146
|
|
|
@@ -198,58 +192,58 @@ module Fox
|
|
|
198
192
|
zmin, zmax = -0.5*@depth, 0.5*@depth
|
|
199
193
|
|
|
200
194
|
# Draw low face
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
195
|
+
GL.Begin(GL::TRIANGLE_STRIP)
|
|
196
|
+
GL.Normal3d(0.0, 0.0, -1.0)
|
|
197
|
+
GL.Vertex3d(xmin, ymin, zmin)
|
|
198
|
+
GL.Vertex3d(xmin, ymax, zmin)
|
|
199
|
+
GL.Vertex3d(xmax, ymin, zmin)
|
|
200
|
+
GL.Vertex3d(xmax, ymax, zmin)
|
|
201
|
+
GL.End()
|
|
208
202
|
|
|
209
203
|
# Draw east face
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
204
|
+
GL.Begin(GL::TRIANGLE_STRIP)
|
|
205
|
+
GL.Normal3d(1.0, 0.0, 0.0)
|
|
206
|
+
GL.Vertex3d(xmax, ymin, zmin)
|
|
207
|
+
GL.Vertex3d(xmax, ymax, zmin)
|
|
208
|
+
GL.Vertex3d(xmax, ymin, zmax)
|
|
209
|
+
GL.Vertex3d(xmax, ymax, zmax)
|
|
210
|
+
GL.End()
|
|
217
211
|
|
|
218
212
|
# Draw high face
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
213
|
+
GL.Begin(GL::TRIANGLE_STRIP)
|
|
214
|
+
GL.Normal3d(0.0, 0.0, 1.0)
|
|
215
|
+
GL.Vertex3d(xmax, ymin, zmax)
|
|
216
|
+
GL.Vertex3d(xmax, ymax, zmax)
|
|
217
|
+
GL.Vertex3d(xmin, ymin, zmax)
|
|
218
|
+
GL.Vertex3d(xmin, ymax, zmax)
|
|
219
|
+
GL.End()
|
|
226
220
|
|
|
227
221
|
# Draw west face
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
222
|
+
GL.Begin(GL::TRIANGLE_STRIP)
|
|
223
|
+
GL.Normal3d(-1.0, 0.0, 0.0)
|
|
224
|
+
GL.Vertex3d(xmin, ymin, zmax)
|
|
225
|
+
GL.Vertex3d(xmin, ymax, zmax)
|
|
226
|
+
GL.Vertex3d(xmin, ymin, zmin)
|
|
227
|
+
GL.Vertex3d(xmin, ymax, zmin)
|
|
228
|
+
GL.End()
|
|
235
229
|
|
|
236
230
|
# Draw north face
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
231
|
+
GL.Begin(GL::TRIANGLE_STRIP)
|
|
232
|
+
GL.Normal3d(0.0, 1.0, 0.0)
|
|
233
|
+
GL.Vertex3d(xmin, ymax, zmin)
|
|
234
|
+
GL.Vertex3d(xmin, ymax, zmax)
|
|
235
|
+
GL.Vertex3d(xmax, ymax, zmin)
|
|
236
|
+
GL.Vertex3d(xmax, ymax, zmax)
|
|
237
|
+
GL.End()
|
|
244
238
|
|
|
245
239
|
# Draw south face
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
240
|
+
GL.Begin(GL::TRIANGLE_STRIP)
|
|
241
|
+
GL.Normal3d(0.0, -1.0, 0.0)
|
|
242
|
+
GL.Vertex3d(xmin, ymin, zmax)
|
|
243
|
+
GL.Vertex3d(xmin, ymin, zmin)
|
|
244
|
+
GL.Vertex3d(xmax, ymin, zmax)
|
|
245
|
+
GL.Vertex3d(xmax, ymin, zmin)
|
|
246
|
+
GL.End()
|
|
253
247
|
end
|
|
254
248
|
end
|
|
255
249
|
|
|
@@ -257,9 +251,6 @@ module Fox
|
|
|
257
251
|
# OpenGL cone object
|
|
258
252
|
#
|
|
259
253
|
class FXGLCone < FXGLShape
|
|
260
|
-
include OpenGL
|
|
261
|
-
include GLU
|
|
262
|
-
|
|
263
254
|
# Cone fidelity
|
|
264
255
|
SLICES_NUMBER = 20
|
|
265
256
|
STACKS_NUMBER = 20
|
|
@@ -316,15 +307,15 @@ module Fox
|
|
|
316
307
|
# Draw this cone into _viewer_ (an FXGLViewer instance).
|
|
317
308
|
#
|
|
318
309
|
def drawshape(viewer)
|
|
319
|
-
quad =
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
310
|
+
quad = GLU.NewQuadric()
|
|
311
|
+
GLU.QuadricDrawStyle(quad, GLU::FILL)
|
|
312
|
+
GL.PushMatrix()
|
|
313
|
+
GL.Rotated(-90, 1, 0, 0)
|
|
314
|
+
GLU.Cylinder(quad, @radius, 0, @height, @slices, @stacks)
|
|
315
|
+
GLU.QuadricOrientation(quad, GLU::INSIDE)
|
|
316
|
+
GLU.Disk(quad, 0, @radius, @slices, @loops)
|
|
317
|
+
GLU.DeleteQuadric(quad)
|
|
318
|
+
GL.PopMatrix()
|
|
328
319
|
end
|
|
329
320
|
end
|
|
330
321
|
|
|
@@ -332,9 +323,6 @@ module Fox
|
|
|
332
323
|
# OpenGL cylinder object
|
|
333
324
|
#
|
|
334
325
|
class FXGLCylinder < FXGLShape
|
|
335
|
-
include OpenGL
|
|
336
|
-
include GLU
|
|
337
|
-
|
|
338
326
|
# Cylinder fidelity
|
|
339
327
|
SLICES_NUMBER = 20
|
|
340
328
|
STACKS_NUMBER = 20
|
|
@@ -391,18 +379,18 @@ module Fox
|
|
|
391
379
|
# Draw this cylinder into _viewer_ (an FXGLViewer instance).
|
|
392
380
|
#
|
|
393
381
|
def drawshape(viewer)
|
|
394
|
-
quad =
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
382
|
+
quad = GLU.NewQuadric()
|
|
383
|
+
GLU.QuadricDrawStyle(quad, GLU::FILL)
|
|
384
|
+
GL.PushMatrix()
|
|
385
|
+
GL.Rotated(-90, 1, 0, 0)
|
|
386
|
+
GLU.Cylinder(quad, @radius, @radius, @height, @slices, @stacks)
|
|
387
|
+
GLU.QuadricOrientation(quad, GLU::INSIDE)
|
|
388
|
+
GLU.Disk(quad, 0, @radius, @slices, @loops)
|
|
389
|
+
GL.Translated(0, 0, @height)
|
|
390
|
+
GLU.QuadricOrientation(quad, GLU::OUTSIDE)
|
|
391
|
+
GLU.Disk(quad, 0, @radius, @slices, @loops)
|
|
392
|
+
GL.PopMatrix()
|
|
393
|
+
GLU.DeleteQuadric(quad)
|
|
406
394
|
end
|
|
407
395
|
end
|
|
408
396
|
|
|
@@ -410,9 +398,6 @@ module Fox
|
|
|
410
398
|
# OpenGL sphere object
|
|
411
399
|
#
|
|
412
400
|
class FXGLSphere < FXGLShape
|
|
413
|
-
include OpenGL
|
|
414
|
-
include GLU
|
|
415
|
-
|
|
416
401
|
# Sphere fidelity
|
|
417
402
|
SLICES_NUMBER = 20
|
|
418
403
|
STACKS_NUMBER = 20
|
|
@@ -460,10 +445,10 @@ module Fox
|
|
|
460
445
|
# Draw this sphere into _viewer_ (an FXGLViewer instance).
|
|
461
446
|
#
|
|
462
447
|
def drawshape(viewer)
|
|
463
|
-
quad =
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
448
|
+
quad = GLU.NewQuadric()
|
|
449
|
+
GLU.QuadricDrawStyle(quad, GLU::FILL)
|
|
450
|
+
GLU.Sphere(quad, @radius, @slices, @stacks)
|
|
451
|
+
GLU.DeleteQuadric(quad)
|
|
467
452
|
end
|
|
468
453
|
end
|
|
469
454
|
end
|