|
Post by vovchik on Jan 15, 2017 17:24:39 GMT 1
Dear Alex,
This is the term output:
EGL Screen Sizes 1280 720 X Screen Sizes 1200 678
and the crosshair is to the left of and below the xcursor.
With kind regards, vovchik
|
|
|
Post by alexfish on Jan 15, 2017 18:00:49 GMT 1
Hi Vovchik
Thanks for testing
have puts some hard coded dims for the viewport
Looking good from here . as in everything fits
need to code the bits in and re-adjust how the perspectives are calculated + The MOUSEX and MOUSEY, not sure if can get all this done today
BR Alex
|
|
|
Post by alexfish on Jan 15, 2017 18:58:47 GMT 1
Hi Vovchik New hugrpi , have made the adjustments to the viewport in the CLS + the hugView. fullscreen mode only for testing Nothing has been done to the Window Mode. have added a line to the original demo it should be at 1,10 to Width -1 ,10, hoping the mouse coords are correct , If not correct , can report the positions , esp the two cursors ,then possible can look further BR Alex code for testing INCLUDE hugrpi.bac HUGOPTIONS ("NOSCALING")
LOCAL rotz = 0 TYPE float win = WINDOW("Test Win", 800, 600) SET(win,1) CANVAS(0, 0, 780, 580) 'gdk = gdk_window_at_pointer(ADDRESS(MOUSEX),ADDRESS(MOUSEY))
WHILE TRUE DO IF KEY() == 65307 THEN bcm_host_deinit() PRINT rotz END END IF
PRINT "EGL Screen Sizes" PRINT State.screen_width PRINT State.screen_height PRINT "X Screen Sizes" PRINT WIDTH PRINT HEIGHT PRINT "************************" LOCAL bc = 0 TYPE float CLS ' Draw BACKGROUND hugView(HGL_2D_ORTHO) glColor4ub(0,0,255,190) RECT(0,0,WIDTH,HEIGHT,1) glColor4ub(255,0,0,205) hugView(HGL_2D_ORTHO) glTranslateOrtho(WIDTH/2,HEIGHT/2) LOCAL bt glColor4ub(255,255,255,255) hugView(HGL_2D_ORTHO) LINE(2,10,WIDTH-2,10)
hugView(HGL_2D_ORTHO) glTranslateOrtho(WIDTH/2,HEIGHT/2) FOR bt = 1 TO 360 SYNC glColor4ub(245,(int)(bt/2) + 60,0,(int)(bt/2) + 60) glRotatef(rotz,0,0,1) glTranslateOrtho(bt,0) QBEZIER(0,0,200,bc,300,-(bc-400),0.1) glRotatef(rotz,0,0,1) glColor4ub(255,0,0,(int)(bt/2) + 60) QBEZIER(0,0,200,bc,300,-(bc-400),0.1) NEXT bt ' Draw crosshair at mouse IF (MOUSEX >= 0) THEN hugView(HGL_CURSOR) glColor4ub(255,255,255,205) hugView(HGL_2D_ORTHO) glTranslateOrtho(MOUSEX,MOUSEY) POLY(12,1,2,0) glRotatef(90,0,0,1) POLY(12,1,2,0) END IF INCR rotz ,1 INCR bc ,3 IF bc >= 600 THEN bc = 0 END IF eglSwapBuffers(State.display, State.surface) WEND
Attachments:hugrpi.bac.bz2 (14.55 KB)
|
|
|
Post by vovchik on Jan 15, 2017 19:19:34 GMT 1
Dear Alex,
Perfect:
EGL Screen Sizes 1280 720 X Screen Sizes 1200 678
And the xcursor lines up appropriately with the crosshair. Way to go! Thanks.
With kind regards, vovchik
|
|
|
Post by alexfish on Jan 21, 2017 16:49:58 GMT 1
Hi vovchik Have taken a closer look at the overscan.c here have semi BaConised the code , the test add 20 x overscan then return the Desktop to where it was. the functions should not write a persistent value , IE can yest the reboot , See Comments in code siting here , overscan setting etc does not need root , hope Yours be the same If working , then one will be able to test the actual desktop + any app , I say App as in the likes of the BaCon Gui, in respect of say fonts Then will add the key commands to enable setting all 4 cords rather than in Pairs + same routine will be added to the hugrpi.bac @ BigBass Joe , Welcome back BR Alex /* code adapted from overscan.c By Russell "ukscone" Davis using code from Broadcom, Dom Cobley & Alex Bradbury */
CONST GET_OVERSCAN = 0x0004000a CONST TST_OVERSCAN = 0x0004400a CONST SET_OVERSCAN = 0x0004800a CONST END_TAG = 0x00000000
PROTO close
DECLARE coord[4] TYPE unsigned
FUNCTION mailbox_property(int file_desc, void *buf) TYPE static int int return_value = ioctl(file_desc, _IOWR(100, 0, char *), buf) /* ioctl error of some kind */ IF (return_value < 0) THEN close(file_desc); END END IF
RETURN return_value
END FUNCTION
FUNCTION get_overscan(int file_desc) TYPE unsigned
LOCAL i=0 LOCAL property[32] TYPE unsigned property[i++] = 0 property[i++] = 0x00000000
property[i++] = GET_OVERSCAN property[i++] = 0x00000010 property[i++] = 0x00000000 property[i++] = 0x00000000 property[i++] = 0x00000000 property[i++] = 0x00000000 property[i++] = 0x00000000 property[i++] = END_TAG property[0] = i*sizeof *property
mailbox_property(file_desc, property) coord[0] = property[5] coord[1] = property[6] coord[2] = property[7] coord[3] = property[8]
RETURN 0
END FUNCTION
FUNCTION set_overscan(int file_desc) TYPE static unsigned LOCAL i=0 LOCAL property[32] TYPE unsigned property[i++] = 0 property[i++] = 0x00000000
property[i++] = SET_OVERSCAN property[i++] = 0x00000010 property[i++] = 0x00000010 property[i++] = coord[0] property[i++] = coord[1] property[i++] = coord[2] property[i++] = coord[3] property[i++] = END_TAG property[0] = i*sizeof *property
mailbox_property(file_desc, property) coord[0] = property[5] coord[1] = property[6] coord[2] = property[7] coord[3] = property[8] RETURN 0
END FUNCTION
LOCAL file_desc
file_desc = open("/dev/vcio", 0) IF (file_desc == -1) THEN PRINT "Fail Exit Now" END ELSE get_overscan(file_desc)
PRINT coord[0]," : ", coord[1]," : ", coord[2]," : ", coord[3] coord[0]= coord[0]+20 set_overscan(file_desc) SLEEP (2000) ' can test no write by commenting the below , then reboot / + cold boot coord[0]= coord[0]-20 set_overscan(file_desc)
close(file_desc) END IF
|
|
|
Post by alexfish on Jan 21, 2017 17:05:10 GMT 1
Ultimately looking at the above , there is a means of getting the pixel data from the gpu + there is an off screen mode for the EGL
|
|
|
Post by vovchik on Jan 21, 2017 18:19:38 GMT 1
Dear Alex, I think you have nailed it: 21 : 21 : 40 : 40
which are precisely my overscan numbers. With kind regards, Bogdan
|
|
|
Post by alexfish on Jan 23, 2017 21:38:31 GMT 1
Hi vovchik Have updated hugrpi to use Raspberry PI scan modes , the bits are separated between the demo code below and the lib pressing F7 takes the user into the scan mode , F6 ,F7,F6 ... should return back to normal F1 TO F4 to shrink F9 to F12 to Expand. this to look at when in scan mode , TOP & BOTTOM should be = values same for LEFT & RIGHT When getting close to certain values the Desktop will appear to pop into place as a guide There is a Red SQUARE/RECT to help . The EGL Cursor should be 1px above and left of the Xcursor. can test what the desktop looks like by pressing ESC , can re enter the demo and change the settings to Your original , then ESC again Or Reboot. When in This World , as regards the Hug Window , the TEXT of the MARKS & EDIT should remain Constant as when Started.. Comments welcome BR Alex Some test code and the lib INCLUDE hugrpi.bac 'HUGOPTIONS ("NOSCALING")
LOCAL strg$ LOCAL iskey LOCAL rotz = 0 TYPE float win = WINDOW("Test Win", 800, 600) lab = MARK("F7 Enable over scan",300,50) lab2 = MARK("TOP",160,50) lab3 = MARK("BOTTOM",160,50) lab4 = MARK("LEFT",160,50) lab5 = MARK("RIGHT",160,50) ATTACH(win,lab,10,10)
ATTACH(win,lab2,10,100) ATTACH(win,lab3,170,100) ATTACH(win,lab4,10,170) ATTACH(win,lab5,170,170)
ed = EDIT(200,200) ATTACH(win,ed,10,220) SET(win,1) CANVAS(0, 0, 780, 580)
SETSCAN(TRUE)
WHILE TRUE DO IF KEY() == 65307 THEN bcm_host_deinit() PRINT rotz END ELIF KEY(== 65475 AND SCANSET) THEN DOSCANSET=0 TEXT(lab , "F7 Enable Over Scan")
IF VCIOSCAN THEN restset_overscan(VCIOSCAN) close(VCIOSCAN) VCIOSCAN=0 END IF RESETKEY() ' key F5 to disable scan set ELIF KEY(== 65476 AND SCANSET) THEN IF NOT(VCIOSCAN) THEN DOSCANSET=1 TEXT(lab , "F6,F7,F6 to Reset Over Scan") ENABLESCANMODE strg$ = "F1- F9+ TOP= " & STR$(hug_scan_coord[0]) TEXT (lab2,strg$) strg$ = "F2- F10+ BOTTOM= " & STR$(hug_scan_coord[1]) TEXT (lab3,strg$) strg$ = "F3- F11+ LEFT= " & STR$(hug_scan_coord[2]) TEXT (lab4,strg$) strg$ = "F4- F12+ RIGHT= " & STR$(hug_scan_coord[3]) TEXT (lab5,strg$) END IF RESETKEY() ' keys F1 to F4 ELIF KEY(== 65470 AND DOSCANSET AND VCIOSCAN) THEN hug_scan_coord[0]= hug_scan_coord[0]+1 set_overscan(VCIOSCAN) strg$ = "F1- F9+ TOP= " & STR$(hug_scan_coord[0]) TEXT (lab2,strg$)
RESETKEY() ELIF KEY(== 65471 AND DOSCANSET AND VCIOSCAN) THEN hug_scan_coord[1]= hug_scan_coord[1]+1 set_overscan(VCIOSCAN) strg$ = "F2- F10+ BOTTOM= " & STR$(hug_scan_coord[1]) TEXT (lab3,strg$) RESETKEY() ELIF KEY(== 65472 AND DOSCANSET AND VCIOSCAN) THEN
hug_scan_coord[2]= hug_scan_coord[2]+1 set_overscan(VCIOSCAN) strg$ = "F3- F11+ LEFT= " & STR$(hug_scan_coord[2]) TEXT (lab4,strg$) RESETKEY()
ELIF KEY(== 65473 AND DOSCANSET AND VCIOSCAN) THEN hug_scan_coord[3]= hug_scan_coord[3]+1 set_overscan(VCIOSCAN) strg$ = "F4- F12+ RIGHT = " & STR$(hug_scan_coord[3]) TEXT (lab5,strg$) ' keys F9 to F12
RESETKEY()
ELIF KEY(== 65478 AND DOSCANSET) THEN
IF hug_scan_coord[0] <=0 THEN ELSE hug_scan_coord[0]= hug_scan_coord[0]-1 set_overscan(VCIOSCAN) strg$ = "F1- F8+TOP= " & STR$(hug_scan_coord[0]) TEXT (lab2,strg$) END IF
RESETKEY()
ELIF KEY(== 65479 AND DOSCANSET AND VCIOSCAN) THEN IF hug_scan_coord[1] <=0 THEN ELSE hug_scan_coord[1]= hug_scan_coord[1]-1 set_overscan(VCIOSCAN) strg$ = "F2- F9+ BOTTOM= " & STR$(hug_scan_coord[1]) TEXT (lab3,strg$) END IF RESETKEY()
ELIF KEY(== 65480 AND DOSCANSET AND VCIOSCAN) THEN IF hug_scan_coord[2] <=0 THEN ELSE hug_scan_coord[2]= hug_scan_coord[2]-1 set_overscan(VCIOSCAN) strg$ = "F3- F11+ LEFT= " & STR$(hug_scan_coord[2]) TEXT (lab4,strg$) END IF
RESETKEY()
ELIF KEY(== 65481 AND DOSCANSET AND VCIOSCAN) THEN IF hug_scan_coord[3] <=0 THEN ELSE hug_scan_coord[3]= hug_scan_coord[3]-1 set_overscan(VCIOSCAN) strg$ = "F4- F12+ RIGHT= " & STR$(hug_scan_coord[3]) TEXT (lab5,strg$) END IF RESETKEY() END IF
LOCAL bc = 0 TYPE float CLS(win) ' Draw BACKGROUND hugView(win,HGL_2D_ORTHO) glColor4ub(0,255,0,50) 'RECT(0,1,WIDTH,HEIGHT-1,1) RECT(hug_scan_coord[2]+1,hug_scan_coord[0]+2,WIDTH-((hug_scan_coord[2]+hug_scan_coord[3])+3 ),HEIGHT-((hug_scan_coord[0]+hug_scan_coord[1])+3 ),1) glColor4ub(255,0,0,205) 'hugView(win,HGL_2D_ORTHO)
LOCAL bt hugView(win,HGL_2D_ORTHO) 'glTranslateOrtho(0,0) glColor4ub(255,0,0,255) glLineWidth(3) RECT(hug_scan_coord[2]+1,hug_scan_coord[0]+2,WIDTH-((hug_scan_coord[2]+hug_scan_coord[3])+3 ),HEIGHT-((hug_scan_coord[0]+hug_scan_coord[1])+3 ),0)
glLineWidth(1) ' Draw crosshair at mouse IF (MOUSEX >= 0) THEN hugView(win,HGL_CURSOR) glColor4ub(0,0,0,255) hugView(win,HGL_2D_ORTHO) glTranslateOrtho(MOUSEX,MOUSEY) POLY(12,1,2,0) glRotatef(90,0,0,1) POLY(12,1,2,0) END IF INCR rotz ,1 INCR bc ,3 IF bc >= 600 THEN bc = 0 END IF SYNC eglSwapBuffers(State.display, State.surface) WEND
Attachments:hugrpi.bac.bz2 (15.16 KB)
|
|
|
Post by alexfish on Jan 23, 2017 22:15:13 GMT 1
Some thoughts , and could it be done.
initial X11 window GTK , + access client side EGL
test client side EGL off screen window
Window Mode , in Walks XCB client side Window
link clientside XCB window to client side EGL off screen window without Mesa Lib.
BR Alex
|
|
|
Post by vovchik on Jan 23, 2017 23:38:54 GMT 1
Dear Alex, I am looking at the code now.It might work w/o MESA. At the moment, I am getting a GTK window with my standard pixmap background, fullscreen, on which I get the big red square, TOP/LEFT/RIGHT/BOTTOM text and an input window in which normal GTK cursor controls and copuy/paste work. Will look more seriously now, because I just compiled and ran to see what I would get. Thanks.... With kind regards, vovchik
|
|
|
Post by alexfish on Jan 24, 2017 0:25:46 GMT 1
Hi Vovchik Plenty of time , from here everything is working as expected need to bolt down the bits , then can add the rest of the bits , but have already added the xcb window in main , the object is that can have some fun as in , example the demo's that be posted. then can see what can be done with the XCB window just tested XCB window , but had to drop down int window mode to get a screen shot with the GTK window + the XCB window need to sort the keep above and keep below's the xcb is the small window (with nothing in it) Just a window dressing with a frame. obvious U can not see the egl SQUARE + the Cursor, but it be there from where I sit BR Alex Attachments:
|
|
|
Post by alexfish on Jan 25, 2017 23:48:30 GMT 1
Hi Vovchik Another day another $ and another demo and why XCB One thing that spoils x11 and EGl is the responce times. can not that in most demo's posted can see a lag between what is done by x11 and what gets drawn by the egl , somewhat can be deemed as Snake Effect here is a demo of using XCB and EGL . the rotating Square follows the mouse. one aspect in all cases the configuration of mouse settings have tested @ RPI Acceleration 5.2 Sensitivity 10 Note users this a RPI 3 demo , do not try on anyother device , milage will = at best no go , to disaster. Added for XCB interest One easy way to get Graphics And text + bitmaps & + xrender into a XCB Window is to Use Cairo:: A tip on this one. Create the initial surface the same as Screen Width And Height , do not forget , one can create sub surfaces to it. Basic api BR Alex Attachments:xcbdemo3.bz2 (16.65 KB)
|
|
|
Post by vovchik on Jan 26, 2017 10:11:03 GMT 1
Dear Alex,
On my Pi3, I get a decorated window that opens and the green rotating square that follows the cursor. The rotating square is tied to the window geometry, but I get my overscan offsets kicking in, so that the sqaare can be outside the bounds of the window on the left and with a margin on the right. The same holds true on the Y axis.
With kind regards, vovchik
|
|
|
Post by alexfish on Jan 26, 2017 11:02:53 GMT 1
Hi Vovchik
Exactly what I expected:: since here ; every draw (inside the GL drawing loop) it is getting geometry(call 1) & mouse info(call 2) from X, at specific points in the (loop)routine
Can rectify this by implementing the ScanCords:: these should be seen in the terminal.
the object here is to reduce the lag effect on the EGL surface, hoping that the GL cursor follows the X cursor within about 20 To 50 pixels; + or - Your Cords.. and should settle at 1pxX1px when the mouse is not moved :: IE it should Jump There , and show no sing of The Snaking Effect. that be the bits I am interested in. the 20 to 50 px:: and the jump.
You Will see this in a full blown fashion if one tests the Experimental GL Glx Drivers , on the desktop. If one dares . BR Alex
|
|
|
Post by alexfish on Jan 26, 2017 11:40:06 GMT 1
Hi Vovchik another XCB demo using Cairo surface , no gl there are certain problematic's getting the Cairo surface to redraw , have not seen any examples that get this correct , either the surface does not show at exposure or until the window is resized , + other's hopping the surface shows in all cases . IE esp the chopping effect does not happen when the window is resized. there will be a slight flicker at times , but, the redraw surface is maxed out to 1920 X 1080 , hoping it does not bust ,, must be run from the terminal , Ctrl to quit. + have to set the permissions before it will exec . hoping to start a new thread for XCB in code projects . esp from a x86 point of view. BR Alex Attachments:xcbcairo.bz2 (4.59 KB)
|
|