Need new gfxlib driver for Windows 7, 8, 10

Windows specific questions.
MrSwiss
Posts: 3444
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Need new gfxlib driver for Windows 7, 8, 10

Postby MrSwiss » Oct 16, 2019 20:35

coderJeff wrote: I may follow-up with actual bug reports; even if just for myself, it's nice to have a ticket to track.
I already have one open on SourceForge: #898 --- DirectX - Driver not working in FBC x64 (WIN)

coderJeff wrote:@macko17, that's excellent! fb gfxlib's DirectX driver now initializes for me on Win7 64-bit. Nice!
Could we please have this fix for this rather "never ending story" (since ver. 1.00.0 / 64 bit).
Preferably in 1.08.0 release?
marcov
Posts: 2936
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Re: Need new gfxlib driver for Windows 7, 8, 10

Postby marcov » Oct 16, 2019 20:36

(this thread got live again, and I saw an old reply on it that could do with some updates)

marcov wrote:
VANYA wrote:In my opinion, the best solution would be to rewrite the fbgfx library under OpenGL. Obvious advantages:


This would be a perfectly valid opinion a few years ago, but you are writing this a week after Apple announced it would drop OpenGL, and the last year Vulkan slowly is getting more relevant for new development


Small update: Apple's recent release of Catalina means the end of opengl-by-default on Apple targets. It is said not to have Vulkan either, only Apple's own Metal layers. There are a few 3rd party libraries like moltenvk that can help a bit there (bridging apis like vulkan to metal), but I'm told they are not very userfriendly.

3) independence from Microsoft. Who knows what they will declare tomorrow obsolete ...


Well, of all the graphics apis, OpenGL has the biggest chance.[/quote]

One can't find one API that works crossplatform on all anymore it seems. So multiple APIs (backends) will be needed.
MrSwiss
Posts: 3444
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Need new gfxlib driver for Windows 7, 8, 10

Postby MrSwiss » Oct 29, 2019 16:29

@coderJeff & macko17,

Thanks for the fix, as well as the merging of it, into FBC 1.08.0-dev.
Tested with the latest nightly build, works like a charm.

Test code:

Code: Select all

' DirectX_Driver-test1.bas -- (c) 2019-10-22, MrSwiss
'
' compile: -s gui           ' only FBC 64, WIN-standalone
'                           ' since it was always okay, in FBC 32

ScreenRes(1024, 768, 32)
Width 1024 \ 8, 768 \ 16

Dim As String   drv

ScreenInfo(,,,,,, drv)
Print "driver: "; drv       ' should return "DirectX" (not "GDI")

Sleep
D.J.Peters
Posts: 8023
Joined: May 28, 2005 3:28
Contact:

Re: Need new gfxlib driver for Windows 7, 8, 10

Postby D.J.Peters » Oct 29, 2019 20:06

Good job it works.

Joshy

Code: Select all

#include once "fbgfx.bi"
dim as string driver
' ScreenControl(FB.SET_DRIVER_NAME,"DirectX")
' ScreenControl(FB.SET_DRIVER_NAME,"GDI")
ScreenRes(1024, 768, 32)
ScreenControl(FB.GET_DRIVER_NAME,driver)
WindowTitle "driver: " & driver
Sleep
coderJeff
Site Admin
Posts: 3170
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: Need new gfxlib driver for Windows 7, 8, 10

Postby coderJeff » Jan 12, 2020 16:50

Recently, adeyblue has been submitting patches for fbgfx bugs plus writing a brand new Direct2D windows driver for fbgfx. It looks pretty good to me. It also makes some changes in how the internals work (and/or used) and I can see some possibilities for tweaking the existing DirectX, GDI, OpenGL drivers. I find the new driver written by adeyblue a little cleaner and easier to follow the existing implementations.

Up until now, adding the Direct2D driver has been independent of all other drivers. Today, I will merge in a change in to fbc 1.08.0 that may affect other drivers. In particular, all fbgfx windows drivers may respond differently to WM_PAINT messages generated by the system, for example when changing active focus or uncovering a fbgfx window underneath another window. May also depend on version of windows. More testing is needed.

If no driver is specified (in screencontrol, or FBGFX environment variable) before SCREEN/SCREENRES statement, then the order that drivers will be tried is "DIRECTX", "GDI", "DIRECT2D". And the OpenGL driver should only initialize if the proper flags are passed to SCREEN/SCREENRES.

So, typically the new "DIRECT2D" driver will not be automatically selected. To try it out must use:

Code: Select all

#include "fbgfx.bi"
ScreenControl fb.SET_DRIVER_NAME, "DIRECT2D"
Screen ....
ScreenRes ....
coderJeff
Site Admin
Posts: 3170
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: Need new gfxlib driver for Windows 7, 8, 10

Postby coderJeff » Jan 12, 2020 17:32

From a few posts ago in this thread:

macko17 wrote:Also, this (and the CreateThread a few lines below) leak the returned thread handle
https://github.com/freebasic/fbc/blob/m ... ngl.c#L431


Working on this one next. Long time bug if using fb.SET_GL_2D_MODE, fb.OGL_2D_AUTO_SYNC with the OpenGL driver.

If anyone is interested:
- Some fbgfx operations are tested automatically by the test suite. All are non-interactive and use a NULL gfx driver to test operations and check results.
- We have a number of bugs that show up related to drawing, refreshing, palette, shaped windows, switching to full screen and back, different graphics modes on different systems, and so on, that can't be tested with the test suite.
- If anyone is interested putting together a series of interactive tests for users to try out, would be helpful.
- Need not necessarily be complicated
- something along the lines of 1) do something, 2) ask the user, did you see ....?, 3) Answer yes/no and log it
- would be helpful to know what works or not in different scenarios and may be helpful to user as a very simple demo of what kinds of things can be done.

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 4 guests