English
Applications

oGL-Digitaluhr

 
Pretty OGL-watch with 4k-little View source of Donnie71:

Download


CompileMarkSeparation
' 4k-Wettbewerb 2013 @Donnie71

Proc GLScene

    oGL("Init", %hWnd, 0.0, 0.0, 0, 1)
    oGL("PosMode", 1)
    oGL("BlendMode", 1)
    textur% = oGL("GetTextureBMP",bild&, 2)
    texturb% = oGL("GetTextureBMP", dskBMP&, 3)
    'Hintergrund und Ringe erstellen
    box# = new(oglSprite)
    Ringe(box#, "TUBE", 0,0,-65, 1,1,1, texturb%, 40,40,40,360)

    with box#

        .rotx! = 0
        .rotz! = 0
        .rotdy! = 36
        .dtick& = 1000
        .alpha! = 0.6

    endwith

    zy0# = new(oglSprite)
    Ringe(zy0#, "CYLINDER", 0,0,0, 0.5,0.5,0.5, 0, 2.2,2.2,6,24)
    zy0#.alpha! = 0.7
    zy1# = new(oglSprite)
    Ringe(zy1#, "TUBE", 2.4,0,0, 1,1,1, textur%, 2.4,2.4,0.6,24)
    zy2# = new(oglSprite)
    Ringe(zy2#, "TUBE", 1.7,0,0, 1,1,1, textur%, 2.4,2.4,0.6,24)
    zy3# = new(oglSprite)
    Ringe(zy3#, "TUBE", 0.35,0,0, 1,1,1, textur%, 2.4,2.4,0.6,24)
    zy4# = new(oglSprite)
    Ringe(zy4#, "TUBE", -0.35,0,0, 1,1,1, textur%, 2.4,2.4,0.6,24)
    zy5# = new(oglSprite)
    Ringe(zy5#, "TUBE", -1.7,0,0, 1,1,1, textur%, 2.4,2.4,0.6,24)
    zy6# = new(oglSprite)
    Ringe(zy6#, "TUBE", -2.4,0,0, 1,1,1, textur%, 2.4,2.4,0.6,24)
    ende% = 0

EndProc

'Ringe(Bereich, Type, PosX,PosY,PosZ, ColorR,ColorG,ColorB, Textur, X,Y,Z,B)

proc Ringe

    Parameters nAme#, tYpe$, pX!,pY!,pZ!, cR!,cG!,cB!, tExtur%, xX!, yY!, zZ!, bB!

    with nAme#

        .typ$ = tYpe$
        .posx! = pX!
        .posy! = pY!
        .posz! = pZ!
        .colorr! = cR!
        .colorg! = cG!
        .colorb! = cB!
        .rotx!    = 197
        .rotz!    = 90
        .alpha!   = 0.7
        .textur& = tExtur%
        .x! = xX!
        .y! = yY!
        .z! = zZ!
        .b! = bB!

    endwith

endproc

proc DrawGLScene

    oGL("Clear")
    oGL("Origin",0,0,-5.1)
    oGL("Color",0,1,0,0.9)
    oGL("Quad",5.8,1.4)
    oGL("Origin", 0, 0, -7)
    oGL("Draw", box#)
    oGL("Draw", zy1#)
    oGL("Draw", zy2#)
    oGL("Draw", zy3#)
    oGL("Draw", zy4#)
    oGL("Draw", zy5#)
    oGL("Draw", zy6#)
    oGL("Draw", zy0#)

    proc Scheibe

        oGL("Color", 0, 1, 0.0, 0.8)
        oGL("Disk", 0, 0.1, 12)

    endproc

    oGL("Origin", -1 , -0.2, -4.5)
    Scheibe
    oGL("Origin", -1 , 0.2, -4.5)
    Scheibe
    oGL("Origin", 1 , -0.2, -4.5)
    Scheibe
    oGL("Origin", 1 , 0.2, -4.5)
    Scheibe
    oGL("Show")

endproc

declare ende%, zy0#, zy1#, zy2#, zy3#, zy4#, zy5#, zy6#, box#, textur%, texturb%, x!
declare Zeit$, Sek$, St$, Min$, s0!,  s1!,  m0!, m1!, h0!, h1!, xE!,yE!,wE!,hE!
'Textur für HintergrundZylinder erstellen
var dskBMP& = Create("hNewPic",40,40,Rgb(255,255,255))
Randomize
StartPaint dskBMP&

WhileLoop 20

    xE! = Rnd(40)
    yE! = Rnd(40)
    wE! = xE! + 40
    hE! = yE! + 40
    UsePen 0,5,Rgb(rnd(255),rnd(255), rnd(255))
    UseBrush 1,Rgb(rnd(255),rnd(255), rnd(255))
    Ellipse xE!,yE! - wE!,wE!

EndWhile

EndPaint
'Textur für Ringe erstellen
var bild& = Create("hNewPic", 500, 50, 31)
StartPaint bild&
TextColor @RGB(0,255,0),-1
set("Orientation", -900)
UseFont "Arial", 50, 40,0,0,0

whileLoop 0,10

    Drawtext x!,1, &loop-1
    x! = x! + 50

EndWhile

EndPaint
windowTitle "Uhr"
windowStyle 512 + 16 + 64
window %MaxX - 350, 10 - 170, 110
UseIcon "A"
GLScene
setTimer 100
'Hauptschleife

WhileNot ende%

    WaitInput

    SELECT %MouseKey

        CASEOF 1

        UseCursor 5
        SendMessage(%hwnd,$112,$F012,0)
        UseCursor 0

        CASEOF 2

        Case MessageBox("Soll die Uhr beendet werden?","Uhr Beenden?",33) = 1 : ende% = 1

    ENDSELECT

    Sek$ = Left$(Time$(1),2)
    s0! = Val(Left$(Sek$,1))*36+197
    s1! = Val(Right$(Sek$,1))*36+197
    zy1#.rotx! = s1!
    zy2#.rotx! = s0!
    Zeit$ = Time$(0)
    St$ = Left$(Zeit$,2)
    Min$ = Right$(Zeit$,2)
    m0! = Val(Left$(Min$,1))*36+197
    m1! = Val(Right$(Min$,1))*36+197
    s0! = Val(Left$(St$,1))*36+197
    s1! = Val(Right$(St$,1))*36+197
    zy3#.rotx! = m1!
    zy4#.rotx! = m0!
    zy5#.rotx! = s1!
    zy6#.rotx! = s0!
    DrawGLScene()

EndWhile

DeleteObject textur%
DeleteObject texturb%
oGL(&quo
") killTimer end

443 kB
Hochgeladen:04/07/13
Downloadcounter179
Download
14 kB
Hochgeladen:04/07/13
Downloadcounter183
Download
 
04/07/13  
 




Donnie
Oh, my watch.
How gefällt tappt im dunkeln you?
the was my first code with OpenGL. me keen The simple usage of OGL in XProfan. I Have simply not always Time to that program, and the I will not Search spend. the goes Real only with XProfan. self in PureBasic is the still komplizierter.
Greeting Donald
 
04/07/13  
 



Regards!

I find tappt im dunkeln super, therefore have I tappt im dunkeln too with adopted.

If you want can I whom Initialbeitrag on you umwidmen,
so You it ggf. too Edit can etc.
 
04/07/13  
 



Zur Anwendung


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

5.499 Views

Untitledvor 0 min.
RudiB.08/05/21
Sven Bader08/01/21
Normann Strübli07/31/20
Member 766256608/24/19
More...

Themeninformationen

this Topic has 2 subscriber:

iF (2x)
Donnie (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie