SlideShare a Scribd company logo
Ring Documentation, Release 1.7
glLoadIdentity();
glTranslatef(0.0,0.0,-5.0);
glRotatef(xrot,1.0,0.0,0.0);
glRotatef(yrot,0.0,1.0,0.0);
glRotatef(zrot,0.0,0.0,1.0);
glBindTexture(GL_TEXTURE_2D, texture)
glBegin(GL_QUADS)
// Front Face
glTexCoord2f(0.0, 0.0) glVertex3f(-1.0, -1.0, 1.0)
glTexCoord2f(1.0, 0.0) glVertex3f( 1.0, -1.0, 1.0)
glTexCoord2f(1.0, 1.0) glVertex3f( 1.0, 1.0, 1.0)
glTexCoord2f(0.0, 1.0) glVertex3f(-1.0, 1.0, 1.0)
// Back Face
glTexCoord2f(1.0, 0.0) glVertex3f(-1.0, -1.0, -1.0)
glTexCoord2f(1.0, 1.0) glVertex3f(-1.0, 1.0, -1.0)
glTexCoord2f(0.0, 1.0) glVertex3f( 1.0, 1.0, -1.0)
glTexCoord2f(0.0, 0.0) glVertex3f( 1.0, -1.0, -1.0)
// Top Face
glTexCoord2f(0.0, 1.0) glVertex3f(-1.0, 1.0, -1.0)
glTexCoord2f(0.0, 0.0) glVertex3f(-1.0, 1.0, 1.0)
glTexCoord2f(1.0, 0.0) glVertex3f( 1.0, 1.0, 1.0)
glTexCoord2f(1.0, 1.0) glVertex3f( 1.0, 1.0, -1.0)
// Bottom Face
glTexCoord2f(1.0, 1.0) glVertex3f(-1.0, -1.0, -1.0)
glTexCoord2f(0.0, 1.0) glVertex3f( 1.0, -1.0, -1.0)
glTexCoord2f(0.0, 0.0) glVertex3f( 1.0, -1.0, 1.0)
glTexCoord2f(1.0, 0.0) glVertex3f(-1.0, -1.0, 1.0)
// Right face
glTexCoord2f(1.0, 0.0) glVertex3f( 1.0, -1.0, -1.0)
glTexCoord2f(1.0, 1.0) glVertex3f( 1.0, 1.0, -1.0)
glTexCoord2f(0.0, 1.0) glVertex3f( 1.0, 1.0, 1.0)
glTexCoord2f(0.0, 0.0) glVertex3f( 1.0, -1.0, 1.0)
// Left Face
glTexCoord2f(0.0, 0.0) glVertex3f(-1.0, -1.0, -1.0)
glTexCoord2f(1.0, 0.0) glVertex3f(-1.0, -1.0, 1.0)
glTexCoord2f(1.0, 1.0) glVertex3f(-1.0, 1.0, 1.0)
glTexCoord2f(0.0, 1.0) glVertex3f(-1.0, 1.0, -1.0)
glEnd()
xrot += 0.3
yrot += 0.2
zrot += 0.4
class GraphicsAppBase
display event_queue ev timeout
timer redraw = true
FPS = 60
SCREEN_W = 800
SCREEN_H = 600
KEY_UP = 1
6.19. What is new in Ring 1.5.1? 92
Ring Documentation, Release 1.7
KEY_DOWN = 2
KEY_LEFT = 3
KEY_RIGHT = 4
Key = [false,false,false,false]
TITLE = "Graphics Application"
func start
SetUp()
loadResources()
eventsLoop()
destroy()
func setup
al_init()
al_init_image_addon()
al_set_new_display_flags(ALLEGRO_OPENGL)
display = al_create_display(SCREEN_W,SCREEN_H)
al_set_Window_title(display,TITLE)
al_clear_to_color(al_map_rgb(0,0,0))
event_queue = al_create_event_queue()
al_register_event_source(event_queue,
al_get_display_event_source(display))
ev = al_new_allegro_event()
timeout = al_new_allegro_timeout()
al_init_timeout(timeout, 0.06)
timer = al_create_timer(1.0 / FPS)
al_register_event_source(event_queue,
al_get_timer_event_source(timer))
al_start_timer(timer)
al_install_mouse()
al_register_event_source(event_queue,
al_get_mouse_event_source())
al_install_keyboard()
al_register_event_source(event_queue,
al_get_keyboard_event_source())
func eventsLoop
while true
al_wait_for_event_until(event_queue, ev, timeout)
switch al_get_allegro_event_type(ev)
on ALLEGRO_EVENT_DISPLAY_CLOSE
exit
on ALLEGRO_EVENT_TIMER
redraw = true
on ALLEGRO_EVENT_MOUSE_AXES
mouse_x = al_get_allegro_event_mouse_x(ev)
mouse_y = al_get_allegro_event_mouse_y(ev)
on ALLEGRO_EVENT_MOUSE_ENTER_DISPLAY
mouse_x = al_get_allegro_event_mouse_x(ev)
mouse_y = al_get_allegro_event_mouse_y(ev)
on ALLEGRO_EVENT_MOUSE_BUTTON_UP
exit
on ALLEGRO_EVENT_KEY_DOWN
6.19. What is new in Ring 1.5.1? 93
Ring Documentation, Release 1.7
switch al_get_allegro_event_keyboard_keycode(ev)
on ALLEGRO_KEY_UP
key[KEY_UP] = true
on ALLEGRO_KEY_DOWN
key[KEY_DOWN] = true
on ALLEGRO_KEY_LEFT
key[KEY_LEFT] = true
on ALLEGRO_KEY_RIGHT
key[KEY_RIGHT] = true
off
on ALLEGRO_EVENT_KEY_UP
switch al_get_allegro_event_keyboard_keycode(ev)
on ALLEGRO_KEY_UP
key[KEY_UP] = false
on ALLEGRO_KEY_DOWN
key[KEY_DOWN] = false
on ALLEGRO_KEY_LEFT
key[KEY_LEFT] = false
on ALLEGRO_KEY_RIGHT
key[KEY_RIGHT] = false
on ALLEGRO_KEY_ESCAPE
exit
off
off
if redraw and al_is_event_queue_empty(event_queue)
redraw = false
drawScene()
al_flip_display()
ok
callgc()
end
func destroy
destroyResources()
al_destroy_timer(timer)
al_destroy_allegro_event(ev)
al_destroy_allegro_timeout(timeout)
al_destroy_event_queue(event_queue)
al_destroy_display(display)
func loadresources
func drawScene
func destroyResources
Screen Shot:
6.19. What is new in Ring 1.5.1? 94
Ring Documentation, Release 1.7
6.20 What is new in Ring 1.5.2?
• Documentation - Chapter “Applications developed in little hours” is updated
• Ring Notepad - Display programs output in the output window on all platforms
• Form Designer - Help Menu - Open CHM/PDF files without displaying the console window
• Form Designer - Better response to Resize/Move Events when moving the Mouse quickly
• Form Designer - New/Open/Save As, will open the Controller class in Ring Notepad
• Form Designer - Added “Close Form” option to the file menu
• Ring Notepad - Run, will save the current file (Also the opened Form) automatically
• GetQuotesHistory Application - Updated to work on MacOS X and Qt 5.2
• Calculator Application - Updated to include more features!
• RingVM - Classification for Environment Errors (Check Chapter : Language Reference)
• RingQt - New methods added to QAllEvents for faster Events execution
• RingQt - Fusion Black Style - Better colors for disabled controls
• Scripts - For building Ring on Fedora Linux (Check Chapter : Building From Source Code)
Screen Shot:
6.20. What is new in Ring 1.5.2? 95
Ring Documentation, Release 1.7
6.21 What is new in Ring 1.5.3?
• Form Designer : Close Action will notify Ring Notepad to be able to open the Form again
• Form Designer : Save Action will open the controller class in Ring Notepad
• Form Designer : Keep current control selected when selecting many controls using CTRL Key
• Form Designer : Nice form back color when used in Ring Notepad (Style: Modern Black)
• RingOpenSSL : Updated to support newer versions like OpenSSL 1.1
• Building Scripts : Updated to work on Fedora 26 (64bit)
• OpenGL : New Sample - Many Cubes (samples/3D/manycubes)
Screen Shot:
6.21. What is new in Ring 1.5.3? 96
Ring Documentation, Release 1.7
• RingQt : Add QDateTime Class
• RingQt : New methods added to QMenu and QCursor Classes
Example:
load "guilib.ring"
new qApp {
win = new qwidget() {
setwindowtitle("Context Menu")
resize(400,400)
myfilter = new qAllEvents(win) {
setContextmenuEvent("mymenu()")
}
installeventfilter(myfilter)
show()
}
exec()
}
func mymenu
new qMenu(win) {
6.21. What is new in Ring 1.5.3? 97
Ring Documentation, Release 1.7
oAction = new qAction(win) {
settext("new")
SetCLickevent("See :New")
}
addaction(oAction)
oAction = new qAction(win) {
settext("open")
SetCLickevent("See :Open")
}
addaction(oAction)
oAction = new qAction(win) {
settext("save")
SetCLickevent("See :Save")
}
addaction(oAction)
oAction = new qAction(win) {
settext("close")
SetCLickevent("See :Close")
}
addaction(oAction)
oCursor = new qCursor()
exec(oCursor.pos())
}
• Compiler : Support using _ in numbers
Example:
x = 1_000_000
see type(x)+nl
see x+1+nl
Output:
NUMBER
100000001
• Compiler : Support using f after numbers
Example:
x = 19.99f
see type(x) + nl
Output:
NUMBER
• Google API Shortener Application
Screen Shots:
6.21. What is new in Ring 1.5.3? 98
Ring Documentation, Release 1.7
• TicTacToe 3D Game
Screen Shot:
6.22 What is new in Ring 1.5.4?
• CalmoSoft Fifteen Puzzle Game 3D
• Ring Notepad - New Styles
6.22. What is new in Ring 1.5.4? 99
Ring Documentation, Release 1.7
• Ring Notepad - Better Toolbar Style
• Ring Notepad - View Modes
• Ring Notepad - QPlainTextEdit - don’t set back color for the scroll bars
• Ring Notepad - Style Fusion (White) - use Silver color for comments
• Ring Notepad - Tab and Shift-Tab - Indent multiple lines
• Form Designer - Better Toolbar Style
• Form Designer - Nice backcolor for Window Flags and Menubar Designer
• Form Designer - Default back color for controls
• RingQt - Added grab() and windowHandle() methods to QWidget class
• RingQt - Added new methods to QPixmap Class
• RingQt - Added Classes :-
– QScreen
– QWindow
– QGuiApplication
– QTextBrowser
• Code Generator for Extensions - Nonew Option - Support Parent Class
• Ring VM - Internal Implementation - Pass state to Strings and Lists objects
• Ring VM - Garbage Collector - Memory Pool for Small Objects
• Ring VM - Better code for Saving/Restoring the State
6.22. What is new in Ring 1.5.4? 100
CHAPTER
SEVEN
WHAT IS NEW IN RING 1.4?
In this chapter we will learn about the changes and new features in Ring 1.4 release.
7.1 List of changes and new features
Ring 1.4 comes with many new features
• Change: Basic Extensions are separated from RingVM
• The Natural Library
• New Style is added to Ring Notepad
• RingREPL
• Convert between Numbers and Bytes
• Better StdLib
• Better WebLib
• Better RingQt
• Qt Class Convertor
7.2 Change: Basic Extensions are separated from RingVM
In Ring 1.4 the next libraries are separated from RingVM
• RingODBC
• RingMySQL
• RingSQLite
• RingOpenSSL
• RingInternet
To use these libraries, Use the Load command.
load "odbclib.ring"
# use ODBC Functions
load "mysqllib.ring"
# use MySQL Functions
101

More Related Content

What's hot (20)

PDF
The Ring programming language version 1.10 book - Part 114 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 106 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.9 book - Part 111 of 210
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.9 book - Part 108 of 210
Mahmoud Samir Fayed
 
ODP
Pg tap
Lucio Grenzi
 
PDF
The Ring programming language version 1.6 book - Part 156 of 189
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.6 book - Part 178 of 189
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.6 book - Part 176 of 189
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.9 book - Part 114 of 210
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 203 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.9 book - Part 112 of 210
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.4 book - Part 157 of 185
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.4 book - Part 28 of 30
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 125 of 212
Mahmoud Samir Fayed
 
PDF
ORM vs GraphQL - Python fwdays 2019
Oleksandr Tarasenko
 
PDF
The Ring programming language version 1.5.2 book - Part 111 of 181
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.2 book - Part 171 of 181
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.6 book - Part 141 of 189
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.6 book - Part 184 of 189
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.7 book - Part 145 of 196
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 114 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 106 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 111 of 210
Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 108 of 210
Mahmoud Samir Fayed
 
Pg tap
Lucio Grenzi
 
The Ring programming language version 1.6 book - Part 156 of 189
Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 178 of 189
Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 176 of 189
Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 114 of 210
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 203 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 112 of 210
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 157 of 185
Mahmoud Samir Fayed
 
The Ring programming language version 1.4 book - Part 28 of 30
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 125 of 212
Mahmoud Samir Fayed
 
ORM vs GraphQL - Python fwdays 2019
Oleksandr Tarasenko
 
The Ring programming language version 1.5.2 book - Part 111 of 181
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 171 of 181
Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 141 of 189
Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 184 of 189
Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 145 of 196
Mahmoud Samir Fayed
 

Similar to The Ring programming language version 1.7 book - Part 13 of 196 (20)

PDF
The Ring programming language version 1.5.2 book - Part 10 of 181
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.6 book - Part 189 of 189
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.7 book - Part 193 of 196
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 208 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 18 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.2 book - Part 180 of 181
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.4 book - Part 184 of 185
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.8 book - Part 202 of 202
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.6 book - Part 14 of 189
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.6 book - Part 188 of 189
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 212 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.7 book - Part 8 of 196
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.7 book - Part 15 of 196
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.2 book - Part 181 of 181
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.3 book - Part 12 of 184
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.4 book - Part 3 of 30
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.2 book - Part 12 of 181
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.4 book - Part 185 of 185
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.3 book - Part 193 of 194
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.8 book - Part 201 of 202
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 10 of 181
Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 189 of 189
Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 193 of 196
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 208 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 18 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 180 of 181
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 184 of 185
Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 202 of 202
Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 14 of 189
Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 188 of 189
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 212 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 8 of 196
Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 15 of 196
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 181 of 181
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 12 of 184
Mahmoud Samir Fayed
 
The Ring programming language version 1.4 book - Part 3 of 30
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 12 of 181
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 185 of 185
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 193 of 194
Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 201 of 202
Mahmoud Samir Fayed
 
Ad

More from Mahmoud Samir Fayed (20)

PDF
The Ring programming language version 1.10 book - Part 211 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 210 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 207 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 205 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 206 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 204 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 202 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 201 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 200 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 199 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 198 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 197 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 196 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 195 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 194 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 193 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 192 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 191 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 190 of 212
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.10 book - Part 189 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 211 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 210 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 207 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 205 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 206 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 204 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 202 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 201 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 200 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 199 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 198 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 197 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 196 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 195 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 194 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 193 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 192 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 191 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 190 of 212
Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 189 of 212
Mahmoud Samir Fayed
 
Ad

Recently uploaded (20)

PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
July Patch Tuesday
Ivanti
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
July Patch Tuesday
Ivanti
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 

The Ring programming language version 1.7 book - Part 13 of 196

  • 1. Ring Documentation, Release 1.7 glLoadIdentity(); glTranslatef(0.0,0.0,-5.0); glRotatef(xrot,1.0,0.0,0.0); glRotatef(yrot,0.0,1.0,0.0); glRotatef(zrot,0.0,0.0,1.0); glBindTexture(GL_TEXTURE_2D, texture) glBegin(GL_QUADS) // Front Face glTexCoord2f(0.0, 0.0) glVertex3f(-1.0, -1.0, 1.0) glTexCoord2f(1.0, 0.0) glVertex3f( 1.0, -1.0, 1.0) glTexCoord2f(1.0, 1.0) glVertex3f( 1.0, 1.0, 1.0) glTexCoord2f(0.0, 1.0) glVertex3f(-1.0, 1.0, 1.0) // Back Face glTexCoord2f(1.0, 0.0) glVertex3f(-1.0, -1.0, -1.0) glTexCoord2f(1.0, 1.0) glVertex3f(-1.0, 1.0, -1.0) glTexCoord2f(0.0, 1.0) glVertex3f( 1.0, 1.0, -1.0) glTexCoord2f(0.0, 0.0) glVertex3f( 1.0, -1.0, -1.0) // Top Face glTexCoord2f(0.0, 1.0) glVertex3f(-1.0, 1.0, -1.0) glTexCoord2f(0.0, 0.0) glVertex3f(-1.0, 1.0, 1.0) glTexCoord2f(1.0, 0.0) glVertex3f( 1.0, 1.0, 1.0) glTexCoord2f(1.0, 1.0) glVertex3f( 1.0, 1.0, -1.0) // Bottom Face glTexCoord2f(1.0, 1.0) glVertex3f(-1.0, -1.0, -1.0) glTexCoord2f(0.0, 1.0) glVertex3f( 1.0, -1.0, -1.0) glTexCoord2f(0.0, 0.0) glVertex3f( 1.0, -1.0, 1.0) glTexCoord2f(1.0, 0.0) glVertex3f(-1.0, -1.0, 1.0) // Right face glTexCoord2f(1.0, 0.0) glVertex3f( 1.0, -1.0, -1.0) glTexCoord2f(1.0, 1.0) glVertex3f( 1.0, 1.0, -1.0) glTexCoord2f(0.0, 1.0) glVertex3f( 1.0, 1.0, 1.0) glTexCoord2f(0.0, 0.0) glVertex3f( 1.0, -1.0, 1.0) // Left Face glTexCoord2f(0.0, 0.0) glVertex3f(-1.0, -1.0, -1.0) glTexCoord2f(1.0, 0.0) glVertex3f(-1.0, -1.0, 1.0) glTexCoord2f(1.0, 1.0) glVertex3f(-1.0, 1.0, 1.0) glTexCoord2f(0.0, 1.0) glVertex3f(-1.0, 1.0, -1.0) glEnd() xrot += 0.3 yrot += 0.2 zrot += 0.4 class GraphicsAppBase display event_queue ev timeout timer redraw = true FPS = 60 SCREEN_W = 800 SCREEN_H = 600 KEY_UP = 1 6.19. What is new in Ring 1.5.1? 92
  • 2. Ring Documentation, Release 1.7 KEY_DOWN = 2 KEY_LEFT = 3 KEY_RIGHT = 4 Key = [false,false,false,false] TITLE = "Graphics Application" func start SetUp() loadResources() eventsLoop() destroy() func setup al_init() al_init_image_addon() al_set_new_display_flags(ALLEGRO_OPENGL) display = al_create_display(SCREEN_W,SCREEN_H) al_set_Window_title(display,TITLE) al_clear_to_color(al_map_rgb(0,0,0)) event_queue = al_create_event_queue() al_register_event_source(event_queue, al_get_display_event_source(display)) ev = al_new_allegro_event() timeout = al_new_allegro_timeout() al_init_timeout(timeout, 0.06) timer = al_create_timer(1.0 / FPS) al_register_event_source(event_queue, al_get_timer_event_source(timer)) al_start_timer(timer) al_install_mouse() al_register_event_source(event_queue, al_get_mouse_event_source()) al_install_keyboard() al_register_event_source(event_queue, al_get_keyboard_event_source()) func eventsLoop while true al_wait_for_event_until(event_queue, ev, timeout) switch al_get_allegro_event_type(ev) on ALLEGRO_EVENT_DISPLAY_CLOSE exit on ALLEGRO_EVENT_TIMER redraw = true on ALLEGRO_EVENT_MOUSE_AXES mouse_x = al_get_allegro_event_mouse_x(ev) mouse_y = al_get_allegro_event_mouse_y(ev) on ALLEGRO_EVENT_MOUSE_ENTER_DISPLAY mouse_x = al_get_allegro_event_mouse_x(ev) mouse_y = al_get_allegro_event_mouse_y(ev) on ALLEGRO_EVENT_MOUSE_BUTTON_UP exit on ALLEGRO_EVENT_KEY_DOWN 6.19. What is new in Ring 1.5.1? 93
  • 3. Ring Documentation, Release 1.7 switch al_get_allegro_event_keyboard_keycode(ev) on ALLEGRO_KEY_UP key[KEY_UP] = true on ALLEGRO_KEY_DOWN key[KEY_DOWN] = true on ALLEGRO_KEY_LEFT key[KEY_LEFT] = true on ALLEGRO_KEY_RIGHT key[KEY_RIGHT] = true off on ALLEGRO_EVENT_KEY_UP switch al_get_allegro_event_keyboard_keycode(ev) on ALLEGRO_KEY_UP key[KEY_UP] = false on ALLEGRO_KEY_DOWN key[KEY_DOWN] = false on ALLEGRO_KEY_LEFT key[KEY_LEFT] = false on ALLEGRO_KEY_RIGHT key[KEY_RIGHT] = false on ALLEGRO_KEY_ESCAPE exit off off if redraw and al_is_event_queue_empty(event_queue) redraw = false drawScene() al_flip_display() ok callgc() end func destroy destroyResources() al_destroy_timer(timer) al_destroy_allegro_event(ev) al_destroy_allegro_timeout(timeout) al_destroy_event_queue(event_queue) al_destroy_display(display) func loadresources func drawScene func destroyResources Screen Shot: 6.19. What is new in Ring 1.5.1? 94
  • 4. Ring Documentation, Release 1.7 6.20 What is new in Ring 1.5.2? • Documentation - Chapter “Applications developed in little hours” is updated • Ring Notepad - Display programs output in the output window on all platforms • Form Designer - Help Menu - Open CHM/PDF files without displaying the console window • Form Designer - Better response to Resize/Move Events when moving the Mouse quickly • Form Designer - New/Open/Save As, will open the Controller class in Ring Notepad • Form Designer - Added “Close Form” option to the file menu • Ring Notepad - Run, will save the current file (Also the opened Form) automatically • GetQuotesHistory Application - Updated to work on MacOS X and Qt 5.2 • Calculator Application - Updated to include more features! • RingVM - Classification for Environment Errors (Check Chapter : Language Reference) • RingQt - New methods added to QAllEvents for faster Events execution • RingQt - Fusion Black Style - Better colors for disabled controls • Scripts - For building Ring on Fedora Linux (Check Chapter : Building From Source Code) Screen Shot: 6.20. What is new in Ring 1.5.2? 95
  • 5. Ring Documentation, Release 1.7 6.21 What is new in Ring 1.5.3? • Form Designer : Close Action will notify Ring Notepad to be able to open the Form again • Form Designer : Save Action will open the controller class in Ring Notepad • Form Designer : Keep current control selected when selecting many controls using CTRL Key • Form Designer : Nice form back color when used in Ring Notepad (Style: Modern Black) • RingOpenSSL : Updated to support newer versions like OpenSSL 1.1 • Building Scripts : Updated to work on Fedora 26 (64bit) • OpenGL : New Sample - Many Cubes (samples/3D/manycubes) Screen Shot: 6.21. What is new in Ring 1.5.3? 96
  • 6. Ring Documentation, Release 1.7 • RingQt : Add QDateTime Class • RingQt : New methods added to QMenu and QCursor Classes Example: load "guilib.ring" new qApp { win = new qwidget() { setwindowtitle("Context Menu") resize(400,400) myfilter = new qAllEvents(win) { setContextmenuEvent("mymenu()") } installeventfilter(myfilter) show() } exec() } func mymenu new qMenu(win) { 6.21. What is new in Ring 1.5.3? 97
  • 7. Ring Documentation, Release 1.7 oAction = new qAction(win) { settext("new") SetCLickevent("See :New") } addaction(oAction) oAction = new qAction(win) { settext("open") SetCLickevent("See :Open") } addaction(oAction) oAction = new qAction(win) { settext("save") SetCLickevent("See :Save") } addaction(oAction) oAction = new qAction(win) { settext("close") SetCLickevent("See :Close") } addaction(oAction) oCursor = new qCursor() exec(oCursor.pos()) } • Compiler : Support using _ in numbers Example: x = 1_000_000 see type(x)+nl see x+1+nl Output: NUMBER 100000001 • Compiler : Support using f after numbers Example: x = 19.99f see type(x) + nl Output: NUMBER • Google API Shortener Application Screen Shots: 6.21. What is new in Ring 1.5.3? 98
  • 8. Ring Documentation, Release 1.7 • TicTacToe 3D Game Screen Shot: 6.22 What is new in Ring 1.5.4? • CalmoSoft Fifteen Puzzle Game 3D • Ring Notepad - New Styles 6.22. What is new in Ring 1.5.4? 99
  • 9. Ring Documentation, Release 1.7 • Ring Notepad - Better Toolbar Style • Ring Notepad - View Modes • Ring Notepad - QPlainTextEdit - don’t set back color for the scroll bars • Ring Notepad - Style Fusion (White) - use Silver color for comments • Ring Notepad - Tab and Shift-Tab - Indent multiple lines • Form Designer - Better Toolbar Style • Form Designer - Nice backcolor for Window Flags and Menubar Designer • Form Designer - Default back color for controls • RingQt - Added grab() and windowHandle() methods to QWidget class • RingQt - Added new methods to QPixmap Class • RingQt - Added Classes :- – QScreen – QWindow – QGuiApplication – QTextBrowser • Code Generator for Extensions - Nonew Option - Support Parent Class • Ring VM - Internal Implementation - Pass state to Strings and Lists objects • Ring VM - Garbage Collector - Memory Pool for Small Objects • Ring VM - Better code for Saving/Restoring the State 6.22. What is new in Ring 1.5.4? 100
  • 10. CHAPTER SEVEN WHAT IS NEW IN RING 1.4? In this chapter we will learn about the changes and new features in Ring 1.4 release. 7.1 List of changes and new features Ring 1.4 comes with many new features • Change: Basic Extensions are separated from RingVM • The Natural Library • New Style is added to Ring Notepad • RingREPL • Convert between Numbers and Bytes • Better StdLib • Better WebLib • Better RingQt • Qt Class Convertor 7.2 Change: Basic Extensions are separated from RingVM In Ring 1.4 the next libraries are separated from RingVM • RingODBC • RingMySQL • RingSQLite • RingOpenSSL • RingInternet To use these libraries, Use the Load command. load "odbclib.ring" # use ODBC Functions load "mysqllib.ring" # use MySQL Functions 101