SlideShare a Scribd company logo
1 of 10
Download to read offline
Ring Documentation, Release 1.6
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
5.19. What is new in Ring 1.5.1? 83
Ring Documentation, Release 1.6
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
5.19. What is new in Ring 1.5.1? 84
Ring Documentation, Release 1.6
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:
5.19. What is new in Ring 1.5.1? 85
Ring Documentation, Release 1.6
5.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 ļ¬les 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 ļ¬le menu
ā€¢ Ring Notepad - Run, will save the current ļ¬le (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 - Classiļ¬cation 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:
5.20. What is new in Ring 1.5.2? 86
Ring Documentation, Release 1.6
5.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:
5.21. What is new in Ring 1.5.3? 87
Ring Documentation, Release 1.6
ā€¢ 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) {
5.21. What is new in Ring 1.5.3? 88
Ring Documentation, Release 1.6
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:
5.21. What is new in Ring 1.5.3? 89
Ring Documentation, Release 1.6
ā€¢ TicTacToe 3D Game
Screen Shot:
5.22 What is new in Ring 1.5.4?
ā€¢ CalmoSoft Fifteen Puzzle Game 3D
ā€¢ Ring Notepad - New Styles
5.22. What is new in Ring 1.5.4? 90
Ring Documentation, Release 1.6
ā€¢ 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
5.22. What is new in Ring 1.5.4? 91
CHAPTER
SIX
WHAT IS NEW IN RING 1.4?
In this chapter we will learn about the changes and new features in Ring 1.4 release.
6.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
6.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
92

More Related Content

What's hot

What's hot (20)

The Ring programming language version 1.10 book - Part 106 of 212
The Ring programming language version 1.10 book - Part 106 of 212The Ring programming language version 1.10 book - Part 106 of 212
The Ring programming language version 1.10 book - Part 106 of 212
Ā 
The Ring programming language version 1.10 book - Part 114 of 212
The Ring programming language version 1.10 book - Part 114 of 212The Ring programming language version 1.10 book - Part 114 of 212
The Ring programming language version 1.10 book - Part 114 of 212
Ā 
The Ring programming language version 1.9 book - Part 108 of 210
The Ring programming language version 1.9 book - Part 108 of 210The Ring programming language version 1.9 book - Part 108 of 210
The Ring programming language version 1.9 book - Part 108 of 210
Ā 
The Ring programming language version 1.7 book - Part 105 of 196
The Ring programming language version 1.7 book - Part 105 of 196The Ring programming language version 1.7 book - Part 105 of 196
The Ring programming language version 1.7 book - Part 105 of 196
Ā 
The Ring programming language version 1.6 book - Part 156 of 189
The Ring programming language version 1.6 book - Part 156 of 189The Ring programming language version 1.6 book - Part 156 of 189
The Ring programming language version 1.6 book - Part 156 of 189
Ā 
The Ring programming language version 1.9 book - Part 111 of 210
The Ring programming language version 1.9 book - Part 111 of 210The Ring programming language version 1.9 book - Part 111 of 210
The Ring programming language version 1.9 book - Part 111 of 210
Ā 
The Ring programming language version 1.5.2 book - Part 111 of 181
The Ring programming language version 1.5.2 book - Part 111 of 181The Ring programming language version 1.5.2 book - Part 111 of 181
The Ring programming language version 1.5.2 book - Part 111 of 181
Ā 
The Ring programming language version 1.9 book - Part 112 of 210
The Ring programming language version 1.9 book - Part 112 of 210The Ring programming language version 1.9 book - Part 112 of 210
The Ring programming language version 1.9 book - Part 112 of 210
Ā 
The Ring programming language version 1.5.4 book - Part 157 of 185
The Ring programming language version 1.5.4 book - Part 157 of 185The Ring programming language version 1.5.4 book - Part 157 of 185
The Ring programming language version 1.5.4 book - Part 157 of 185
Ā 
The Ring programming language version 1.6 book - Part 141 of 189
The Ring programming language version 1.6 book - Part 141 of 189The Ring programming language version 1.6 book - Part 141 of 189
The Ring programming language version 1.6 book - Part 141 of 189
Ā 
The Ring programming language version 1.7 book - Part 145 of 196
The Ring programming language version 1.7 book - Part 145 of 196The Ring programming language version 1.7 book - Part 145 of 196
The Ring programming language version 1.7 book - Part 145 of 196
Ā 
The Ring programming language version 1.5.1 book - Part 52 of 180
The Ring programming language version 1.5.1 book - Part 52 of 180The Ring programming language version 1.5.1 book - Part 52 of 180
The Ring programming language version 1.5.1 book - Part 52 of 180
Ā 
The Ring programming language version 1.6 book - Part 176 of 189
The Ring programming language version 1.6 book - Part 176 of 189The Ring programming language version 1.6 book - Part 176 of 189
The Ring programming language version 1.6 book - Part 176 of 189
Ā 
The Ring programming language version 1.5.2 book - Part 67 of 181
The Ring programming language version 1.5.2 book - Part 67 of 181The Ring programming language version 1.5.2 book - Part 67 of 181
The Ring programming language version 1.5.2 book - Part 67 of 181
Ā 
The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212
Ā 
The Ring programming language version 1.6 book - Part 178 of 189
The Ring programming language version 1.6 book - Part 178 of 189The Ring programming language version 1.6 book - Part 178 of 189
The Ring programming language version 1.6 book - Part 178 of 189
Ā 
The Ring programming language version 1.10 book - Part 75 of 212
The Ring programming language version 1.10 book - Part 75 of 212The Ring programming language version 1.10 book - Part 75 of 212
The Ring programming language version 1.10 book - Part 75 of 212
Ā 
The Ring programming language version 1.9 book - Part 114 of 210
The Ring programming language version 1.9 book - Part 114 of 210The Ring programming language version 1.9 book - Part 114 of 210
The Ring programming language version 1.9 book - Part 114 of 210
Ā 
The Ring programming language version 1.8 book - Part 169 of 202
The Ring programming language version 1.8 book - Part 169 of 202The Ring programming language version 1.8 book - Part 169 of 202
The Ring programming language version 1.8 book - Part 169 of 202
Ā 
ORM vs GraphQL - Python fwdays 2019
ORM vs GraphQL - Python fwdays 2019ORM vs GraphQL - Python fwdays 2019
ORM vs GraphQL - Python fwdays 2019
Ā 

Similar to The Ring programming language version 1.6 book - Part 12 of 189

Similar to The Ring programming language version 1.6 book - Part 12 of 189 (20)

The Ring programming language version 1.5.3 book - Part 11 of 184
The Ring programming language version 1.5.3 book - Part 11 of 184The Ring programming language version 1.5.3 book - Part 11 of 184
The Ring programming language version 1.5.3 book - Part 11 of 184
Ā 
The Ring programming language version 1.5.1 book - Part 9 of 180
The Ring programming language version 1.5.1 book - Part 9 of 180The Ring programming language version 1.5.1 book - Part 9 of 180
The Ring programming language version 1.5.1 book - Part 9 of 180
Ā 
The Ring programming language version 1.10 book - Part 18 of 212
The Ring programming language version 1.10 book - Part 18 of 212The Ring programming language version 1.10 book - Part 18 of 212
The Ring programming language version 1.10 book - Part 18 of 212
Ā 
The Ring programming language version 1.8 book - Part 15 of 202
The Ring programming language version 1.8 book - Part 15 of 202The Ring programming language version 1.8 book - Part 15 of 202
The Ring programming language version 1.8 book - Part 15 of 202
Ā 
The Ring programming language version 1.5.2 book - Part 10 of 181
The Ring programming language version 1.5.2 book - Part 10 of 181The Ring programming language version 1.5.2 book - Part 10 of 181
The Ring programming language version 1.5.2 book - Part 10 of 181
Ā 
The Ring programming language version 1.9 book - Part 17 of 210
The Ring programming language version 1.9 book - Part 17 of 210The Ring programming language version 1.9 book - Part 17 of 210
The Ring programming language version 1.9 book - Part 17 of 210
Ā 
The Ring programming language version 1.8 book - Part 60 of 202
The Ring programming language version 1.8 book - Part 60 of 202The Ring programming language version 1.8 book - Part 60 of 202
The Ring programming language version 1.8 book - Part 60 of 202
Ā 
The Ring programming language version 1.5.4 book - Part 11 of 185
The Ring programming language version 1.5.4 book - Part 11 of 185The Ring programming language version 1.5.4 book - Part 11 of 185
The Ring programming language version 1.5.4 book - Part 11 of 185
Ā 
The Ring programming language version 1.9 book - Part 13 of 210
The Ring programming language version 1.9 book - Part 13 of 210The Ring programming language version 1.9 book - Part 13 of 210
The Ring programming language version 1.9 book - Part 13 of 210
Ā 
The Ring programming language version 1.7 book - Part 92 of 196
The Ring programming language version 1.7 book - Part 92 of 196The Ring programming language version 1.7 book - Part 92 of 196
The Ring programming language version 1.7 book - Part 92 of 196
Ā 
The Ring programming language version 1.8 book - Part 11 of 202
The Ring programming language version 1.8 book - Part 11 of 202The Ring programming language version 1.8 book - Part 11 of 202
The Ring programming language version 1.8 book - Part 11 of 202
Ā 
The Ring programming language version 1.5.1 book - Part 12 of 180
The Ring programming language version 1.5.1 book - Part 12 of 180The Ring programming language version 1.5.1 book - Part 12 of 180
The Ring programming language version 1.5.1 book - Part 12 of 180
Ā 
The Ring programming language version 1.5.4 book - Part 13 of 185
The Ring programming language version 1.5.4 book - Part 13 of 185The Ring programming language version 1.5.4 book - Part 13 of 185
The Ring programming language version 1.5.4 book - Part 13 of 185
Ā 
The Ring programming language version 1.5.1 book - Part 7 of 180
The Ring programming language version 1.5.1 book - Part 7 of 180The Ring programming language version 1.5.1 book - Part 7 of 180
The Ring programming language version 1.5.1 book - Part 7 of 180
Ā 
The Ring programming language version 1.10 book - Part 72 of 212
The Ring programming language version 1.10 book - Part 72 of 212The Ring programming language version 1.10 book - Part 72 of 212
The Ring programming language version 1.10 book - Part 72 of 212
Ā 
The Ring programming language version 1.5.4 book - Part 12 of 185
The Ring programming language version 1.5.4 book - Part 12 of 185The Ring programming language version 1.5.4 book - Part 12 of 185
The Ring programming language version 1.5.4 book - Part 12 of 185
Ā 
The Ring programming language version 1.5.4 book - Part 8 of 185
The Ring programming language version 1.5.4 book - Part 8 of 185The Ring programming language version 1.5.4 book - Part 8 of 185
The Ring programming language version 1.5.4 book - Part 8 of 185
Ā 
The Ring programming language version 1.5.3 book - Part 8 of 184
The Ring programming language version 1.5.3 book - Part 8 of 184The Ring programming language version 1.5.3 book - Part 8 of 184
The Ring programming language version 1.5.3 book - Part 8 of 184
Ā 
The Ring programming language version 1.4.1 book - Part 3 of 31
The Ring programming language version 1.4.1 book - Part 3 of 31The Ring programming language version 1.4.1 book - Part 3 of 31
The Ring programming language version 1.4.1 book - Part 3 of 31
Ā 
The Ring programming language version 1.7 book - Part 15 of 196
The Ring programming language version 1.7 book - Part 15 of 196The Ring programming language version 1.7 book - Part 15 of 196
The Ring programming language version 1.7 book - Part 15 of 196
Ā 

More from Mahmoud Samir Fayed

More from Mahmoud Samir Fayed (20)

The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212
Ā 
The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212
Ā 
The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212
Ā 
The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212
Ā 
The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212
Ā 
The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212
Ā 
The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212
Ā 
The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212
Ā 
The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212
Ā 
The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212
Ā 
The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212
Ā 
The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212
Ā 
The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212
Ā 
The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212
Ā 
The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212
Ā 
The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212
Ā 
The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212
Ā 
The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212
Ā 
The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212
Ā 
The Ring programming language version 1.10 book - Part 191 of 212
The Ring programming language version 1.10 book - Part 191 of 212The Ring programming language version 1.10 book - Part 191 of 212
The Ring programming language version 1.10 book - Part 191 of 212
Ā 

Recently uploaded

CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
Ā 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
Ā 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
Ā 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
Ā 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
Ā 

Recently uploaded (20)

CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )šŸ” 9953056974šŸ”(=)/CALL GIRLS SERVICE
Ā 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Ā 
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļøcall girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
Ā 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
Ā 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
Ā 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlanā€™s ...
Ā 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
Ā 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
Ā 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
Ā 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
Ā 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Ā 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Ā 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
Ā 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
Ā 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
Ā 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
Ā 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
Ā 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Ā 
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļøcall girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
call girls in Vaishali (Ghaziabad) šŸ” >ą¼’8448380779 šŸ” genuine Escort Service šŸ”āœ”ļøāœ”ļø
Ā 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
Ā 

The Ring programming language version 1.6 book - Part 12 of 189

  • 1. Ring Documentation, Release 1.6 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 5.19. What is new in Ring 1.5.1? 83
  • 2. Ring Documentation, Release 1.6 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 5.19. What is new in Ring 1.5.1? 84
  • 3. Ring Documentation, Release 1.6 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: 5.19. What is new in Ring 1.5.1? 85
  • 4. Ring Documentation, Release 1.6 5.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 ļ¬les 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 ļ¬le menu ā€¢ Ring Notepad - Run, will save the current ļ¬le (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 - Classiļ¬cation 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: 5.20. What is new in Ring 1.5.2? 86
  • 5. Ring Documentation, Release 1.6 5.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: 5.21. What is new in Ring 1.5.3? 87
  • 6. Ring Documentation, Release 1.6 ā€¢ 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) { 5.21. What is new in Ring 1.5.3? 88
  • 7. Ring Documentation, Release 1.6 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: 5.21. What is new in Ring 1.5.3? 89
  • 8. Ring Documentation, Release 1.6 ā€¢ TicTacToe 3D Game Screen Shot: 5.22 What is new in Ring 1.5.4? ā€¢ CalmoSoft Fifteen Puzzle Game 3D ā€¢ Ring Notepad - New Styles 5.22. What is new in Ring 1.5.4? 90
  • 9. Ring Documentation, Release 1.6 ā€¢ 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 5.22. What is new in Ring 1.5.4? 91
  • 10. CHAPTER SIX WHAT IS NEW IN RING 1.4? In this chapter we will learn about the changes and new features in Ring 1.4 release. 6.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 6.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 92