uses console
cls
printl "Redim String Test in procedure"
printl
int count = 20
redim string dat(count)
printl "count = " count
dat(10) = "Hello" : dat(11) = "World!"
printl dat(10) " " dat(11) : printl
'dat(40) = "Goodbye!" // will crash, which is ok
count += 20
printl "count = " count
redim string dat(count)
dat(40) = "Goodbye!"
printl dat(10) " " dat(11) " " dat(40) : printl
sub Extend_dat(string dat(), int count)
printl "in Extend_dat procedure:"
printl "count = " count
printl dat(10) " " dat(11) " " dat(40) : printl
count +=20
printl "count = " count
redim string dat(count)
printl "dat(10,11,40) = ? " dat(10) " " dat(11) " " dat(40) : printl
end sub
Extend_dat(dat(), count)
printl "Enter ..." : waitkey
' oxygen
#ifndef opengles
#ifdef fontA
BuildFont hWnd, hDC, hRC, 1024,"Arial",FW_NORMAL,0
#endif
#ifdef fontB
BuildFont hWnd, hDC, hRC ,1280, "Courier New",600,1
'BuildFont hWnd, hDC, hRC ,1280, fontB
#endif
#endif
#ifndef opengles
uses Glo2\OpenglSceneUtil
#endif
sub BuildFont (sys hWnd,hDC,hRC, int base=1024, string name="Arial", int weight=FW_NORMAL, charset=DEFAULT_CHARSET)
===================================================================================================================
indexbase 0
LOGFONT glFont
sys glFontHandle
'
glFont.lfHeight = 1 'Height Of Font
glFont.lfWeight = weight 'Font Weight FW_BOLD etc
glFont.lfCharSet = charset 'Character Set Identifier
glFont.lfOutPrecision = OUT_TT_PRECIS 'Output Precision
glFont.lfClipPrecision = CLIP_DEFAULT_PRECIS 'Clipping Precision
glFont.lfQuality = ANTIALIASED_QUALITY 'Output Quality
glFont.lfPitchAndFamily = FF_DONTCARE or DEFAULT_PITCH 'Family And Pitch
glFont.lfFaceName = name ' "Arial" "Lucida Console" "Consolas" ' "Courier New" 'Font Name
'
glFontHandle = CreateFontIndirect(@glFont)
glFontHandle = SelectObject(hDC, glFontHandle)
wglUseFontOutlinesA (hDC, 0, 256, base, 0.0, .25, WGL_FONT_POLYGONS, @gmf[base-1024])
DeleteObject(glFontHandle)
end sub
' powerbasic
DECLARE FUNCTION CreateFontIndirectA IMPORT "GDI32.DLL" ALIAS "CreateFontIndirectA" ( _
BYREF lplf AS LOGFONTA _ ' __in CONST LOGFONTA *lplf
) AS DWORD ' HFONT
DECLARE FUNCTION CreateFontIndirectW IMPORT "GDI32.DLL" ALIAS "CreateFontIndirectW" ( _
BYREF lplf AS LOGFONTW _ ' __in CONST LOGFONTW *lplf
) AS DWORD ' HFONT
#IF %DEF(%USEPBDECL)
DECLARE FUNCTION wglUseFontOutlinesA LIB "OPENGL32.DLL" _
ALIAS "wglUseFontOutlinesA" (BYVAL hdc AS DWORD, BYVAL dFirst AS DWORD, _
BYVAL dCount AS DWORD, BYVAL dListBase AS DWORD, _
BYVAL deviation AS SINGLE, BYVAL extrusion AS SINGLE, _
BYVAL iFormat AS LONG, BYVAL lpgmf AS DWORD) AS LONG
#ELSE
DECLARE FUNCTION wglUseFontOutlinesA IMPORT "OPENGL32.DLL" ALIAS "wglUseFontOutlinesA" ( _
BYVAL hdc AS DWORD _ ' __in HDC hdc
, BYVAL dFirst AS DWORD _ ' __in DWORD dFirst
, BYVAL dCount AS DWORD _ ' __in DWORD dCount
, BYVAL dListBase AS DWORD _ ' __in DWORD dListBase
, BYVAL deviation AS SINGLE _ ' __in FLOAT deviation
, BYVAL extrusion AS SINGLE _ ' __in FLOAT extrusion
, BYVAL iFormat AS LONG _ ' __in int iFormat
, BYREF lpgmf AS GLYPHMETRICSFLOAT _ ' __out LPGLYPHMETRICSFLOAT lpgmf
) AS LONG ' BOOL
#ENDIF
' -- > glFontHandle = CreateFontIndirect(@glFont)
' -- > createFontIndirect (wingdi.h)
....
METHOD SetupScene
' Select smooth shading
glShadeModel %GL_SMOOTH
' Specify clear values for the color buffers
glClearColor 0.0!, 0.0!, 0.0!, 0.0!
' Specify the clear value for the depth buffer
glClearDepth 1.0!
' Enable depth comparisons and update the depth buffer
glEnable %GL_DEPTH_TEST
' Specify the value used for depth-buffer comparisons
glDepthFunc %GL_LEQUAL
' Really nice perspective calculations
glHint %GL_PERSPECTIVE_CORRECTION_HINT, %GL_NICEST
' Storage for 96 characters
m_FontBase = glGenLists(96)
' Build the font
m_hFont = CreateFont(-24, _ ' Height of the font
0, _ ' Width of the font
0, _ ' Angle of escapement
0, _ ' Orientation angle
%FW_BOLD, _ ' Font weight
0, _ ' Italic
0, _ ' Underline
0, _ ' Strikeout
%ANSI_CHARSET, _ ' Character set identifier
%OUT_TT_PRECIS, _ ' Output precision
%CLIP_DEFAULT_PRECIS, _ ' Clipping precision
%ANTIALIASED_QUALITY, _ ' Output quality
%FF_DONTCARE OR %DEFAULT_PITCH, _ ' Family and pitch
"Courier New") ' Font name
' Select our font
m_hOldFont = SelectObject(m_hdc, m_hFont)
' Builds 96 characters starting at character 32
wglUseFontBitmaps m_hdc, 32, 96, m_FontBase
' Select previous font
SelectObject m_hdc, m_hOldFont
' Delete the font
DeleteObject m_hFont
END METHOD
' =====================================================================================
' ...
' =======================================================================================
' Render the scene
' =======================================================================================
METHOD RenderScene
' Clear the screen buffer
glClear %GL_COLOR_BUFFER_BIT OR %GL_DEPTH_BUFFER_BIT
' Reset the view
glLoadIdentity
' Move one unit into the screen
glTranslatef 0.0!, 0.0!, -1.0!
' Pulsing colors based on text position
glColor3f 1.0! * COS(m_cnt1), 1.0! * SIN(m_cnt2), 1.0! - 0.5! * COS(m_cnt1 + m_cnt2)
'----------------------------------- problem zone for rotate font text to 90.0 degrees
'
' glrotatef 90.0,0.0,0.0,1.0 '' thats my problem that doesnt run with only this code line
'
' Position the text on the screen
glRasterPos2f -0.45! + 0.05! * COS(m_cnt1), 0.32! * SIN(m_cnt2)
' Print GL text to the screen
m_szText = "Active OpenGL Text With NeHe - " & FORMAT$(m_cnt1, "#.00")
'----------------------------------- problem zone for rotate font text to 90.0 degrees
' Pushes the display list bits
glPushAttrib %GL_LIST_BIT
' Sets the base character to 0
glListBase m_FontBase - 32
' Draws the display list text
glCallLists LEN(m_szText), %GL_UNSIGNED_BYTE, m_szText
' Pops the display list bits
glPopAttrib
' Increase counters
m_cnt1 = m_cnt1 + 0.051!
m_cnt2 = m_cnt2 + 0.005!
' // Exchange the front and back buffers
SwapBuffers m_hdc
END METHOD
' =======================================================================================
' how to set a simple text with gprint to this opgl scene ?
'
'includepath "$\inc\"
$ FileName "t.exe"
'include "RTL32.inc"
'include "RTL64.inc"
$ title "Rotating Triangle"
$ fontA = "Arial",FW_SEMIBOLD '*** set font
int width=640
int height=480
uses OpenglSceneFrame
sub Initialize(sys hWnd)
'=======================
end sub
'
sub Scene(sys hWnd)
'==================
'
static single ang1,angi1=1
'
glClearColor 0.3, 0.3, 0.5, 0
glClear GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT
'
glLoadIdentity
'
'
gltranslatef 0.0, 0.0, -4.0
glrotatef ang1, 0.0, 0.0, 1.0
'
glBegin GL_TRIANGLES
glColor3f 1.0, 0.0, 0.0 : glVertex3f 0.0, 1.0, 0.0
glColor3f 0.0, 1.0, 0.0 : glVertex3f -1.0, -1.0, 0.0
glColor3f 0.0, 0.0, 1.0 : glVertex3f 1.0, -1.0, 0.0
glEnd
'
'UPDATE ROTATION ANGLES
'----------------------
'
glPushMatrix
'
glLoadIdentity
static int framecount
sys x,y
framecount++
gltranslatef -.5,.25,-4.0
''getwordarea "batman",x,y ---> dont want to use it here ;)
glColor3f .99,.50,.50
glscalef .2,.2,.01 '*** larger scale fron ,06
gprint str(framecount)
'
glpopmatrix
glpushMatrix
'glClearColor 0.8, 0.3, 0.5, 0 '*** remove
glscalef .2,.2,.01 '*** respecify scale
glRotatef 90.0,0,0,1
gprint "Hello triangle"
glPopMatrix
ang1+=angi1
if ang1>360 then ang1-=360
'
end sub
sub Release(sys hwnd)
'====================
end sub
Set up the AI model and parameters
AIK.Set Key|Any
$$MOD=claude-3-5-sonnet-20240620
AIK.Set Mes Model|$$MOD
$$LDA=0.21
AIK.Set Temperature|$$LDA
' Initialize the conversation array
ARR.Set Array|1|0|u:Hello, I'd like to discuss some vacation plans.
ARR.Set Array|1|1|a:Hello! I'd be happy to help you with your vacation plans. What kind of vacation are you thinking about?
ARR.Set Array|1|2|u:I'm considering a beach vacation. Can you show me some popular destinations?
ARR.Set Array|1|3|a:Certainly! I'd be glad to suggest some popular beach destinations. However, as an AI language model, I can't actually show you images. But I can describe some popular beach vacation spots for you. Would you like me to list a few options?
ARR.Set Array|1|4|u:Yes, please list a few options.
' Send the conversation to the AI and store the response
AIK.Ask Chat|1|$$RES|1
' Display the AI's response
DBP.Result=$$RES
ENR.
QuoteGreat! Here are some popular beach vacation destinations:
1. Maldives: Known for its crystal-clear waters, white sandy beaches, and luxurious overwater bungalows.
2. Bali, Indonesia: Offers a mix of beautiful beaches, rich culture, and lush landscapes.
3. Maui, Hawaii: Features stunning beaches, volcanic landscapes, and excellent water sports opportunities.
4. Amalfi Coast, Italy: Combines picturesque beaches with charming coastal towns and delicious cuisine.
5. Bora Bora, French Polynesia: Famous for its turquoise lagoon, overwater bungalows, and romantic atmosphere.
Would you like more information about any of these destinations?
AIK.Set Key|Any
$$MOD=claude-3-5-sonnet-20240620
AIK.Set Mes Model|$$MOD
$$LDA=0.21
AIK.Set Temperature|$$LDA
$$PRO=s:You are a Picture Detective finding the smallest difference between pictures using all technical tricks to do so.
AIK.Set System Prompt|$$PRO
' Using Auto-Increment Variable (RIV. / #aiv#) we can easily add more Parts inbetween
RIV.0
$$PIC=u:"%Image=?path\SampleA.png"
ARR.Set Array|1|#aiv#|$$PIC
$$PRO=a:Let this be Picture 1.
ARR.Set Array|1|#aiv#|$$PRO
$$PIC=u:"%Image=?path\SampleC.png"
ARR.Set Array|1|#aiv#|$$PIC
$$PRO=a:Let this be Picture 2.
ARR.Set Array|1|#aiv#|$$PRO
$$PRO=u:Was ist unterschiedlich zwischen den Bildern?
ARR.Set Array|1|#aiv#|$$PRO
AIK.Ask Chat|1|$$RES|0
'AIC.Show Error|$$RES
DBP.Temp=$$LDA
DBP.Result=$$RES
ENR.
'-------------------------------------
[19:57:43] Result=
QuoteNach sorgfältigem Vergleich der beiden Bilder habe ich drei kleine Unterschiede gefunden:
1. In Bild 2 gibt es einen gelben Punkt oder Fleck in der oberen rechten Ecke des Fensters, der in Bild 1 nicht vorhanden ist.
2. In Zeile 7 des Codes wurde in Bild 2 ein Teil des Textes nach '#EXE:' mit Gelb markiert. In Bild 1 ist dieser Teil nicht hervorgehoben.
3. In Zeile 19 des Codes wurde in Bild 2 das letzte 'S' von '$RES' gelb markiert. In Bild 1 ist dieses 'S' nicht hervorgehoben.
Diese subtilen Unterschiede beziehen sich hauptsächlich auf kleine Farbänderungen oder Hervorhebungen im zweiten Bild, die im ersten Bild nicht vorhanden sind.
' how to set a simple text with gprint to this opgl scene ?
'
'includepath "$\inc\"
$ FileName "t.exe"
'include "RTL32.inc"
'include "RTL64.inc"
$ title "Rotating Triangle"
int width=640
int height=480
uses OpenglSceneFrame
sub Initialize(sys hWnd)
'=======================
end sub
'
sub Scene(sys hWnd)
'==================
'
static single ang1,angi1=1
'
glClearColor 0.3, 0.3, 0.5, 0
glClear GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT
'
glLoadIdentity
'
'
gltranslatef 0.0, 0.0, -4.0
glrotatef ang1, 0.0, 0.0, 1.0
'
glBegin GL_TRIANGLES
glColor3f 1.0, 0.0, 0.0 : glVertex3f 0.0, 1.0, 0.0
glColor3f 0.0, 1.0, 0.0 : glVertex3f -1.0, -1.0, 0.0
glColor3f 0.0, 0.0, 1.0 : glVertex3f 1.0, -1.0, 0.0
glEnd
'
'UPDATE ROTATION ANGLES
'----------------------
'
glPushMatrix
'
glLoadIdentity
static int framecount
sys x,y
framecount++
gltranslatef -.5,.25,-4.0
''getwordarea "batman",x,y ---> dont want to use it here ;)
glColor3f .99,.50,.50
glscalef .06,.06,.01
gprint str(framecount)
glpopmatrix
glpushMatrix
glClearColor 0.8, 0.3, 0.5, 0
glRotatef 90.0,0,0,1
gprint "Hello triangle"
glPopMatrix
ang1+=angi1
if ang1>360 then ang1-=360
'
end sub
sub Release(sys hwnd)
'====================
end sub
Page created in 0.143 seconds with 10 queries.