[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - FTE + WEB browsing = libCEF or Berkelium

FTE + WEB browsing = libCEF or Berkelium

Discuss CSQC related programming.

Moderator: InsideQC Admins

FTE + WEB browsing = libCEF or Berkelium

Postby toneddu2000 » Sat Sep 02, 2017 11:18 am

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: FTE + WEB browsing = libCEF or Berkelium

Postby Spike » Sat Sep 02, 2017 2:38 pm

ignore berkelium. its unmaintained, you don't want that security risk.
(you may need to use the plug_load command to explicitly load it. if nothing else it should say if there were missing libraries or not).

try http://triptohell.info/moodles/win32/de ... ef_x86.dll

I ought to try updating libcef but iiuc they only 'fixed' offscreen rendering by disabling all gpu stuff like webgl, so what's the point with new builds? security? hah, yeah, right...
getting cef compiling isn't straight forward, the build system doesn't really understand it, so I've not even bothered trying to automate that stuff.
it'll probably suck for UIs on account of lag and jerks due to no vsync etc. so its useless on the internet because of the security risk, and useless off the internet because it'll feel worse than the equivalent ui made in csqc (and is a pain to get the two talking, too). hence why maintaining/fixing cef isn't one of my highest priorities.
</rant>
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: FTE + WEB browsing = libCEF or Berkelium

Postby toneddu2000 » Sat Sep 02, 2017 8:11 pm

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: FTE + WEB browsing = libCEF or Berkelium

Postby Spike » Sun Sep 03, 2017 3:54 pm

http://triptohell.info/moodles/win32/ft ... 2.1658.zip
I updated my code to work with the latest version of libcef.
It *should* work... it might also blow up. such is life.

Extract to your quake dir.
You can use the menu_downloads thing to enable the plugin (there should also be a prompt to load it up if you've not acknowledged it yet or something. 'c' means that its present but not enabled. you want it checked).
You can then use the 'cef' command to load up a new browser window thing.

Or you can create a shader with a "videomap http://foo" term and then put it on walls. You can use the gecko qc extension if you want to send input/commands to a videomap shader controlled by csqc/menuqc (a location prefixed with 'cmd:' allows you to focus,unfocus, refresh, stop, back, forward, undo, redo, cut, copy, paste, del, selectall, or you can javascript:alert("zomg");, raw:<RAW HTML TEXT> also works, if you want to force it to show a custom page from qc, or http[s]://foo will of course just change the page's current site).
If you're showing it as a 2d page, you'll probably want to gecko_resize your browser to give it a 1:1 physical:virtual ratio so that there's no bluring/scaling (or just set vid_conautoscale 1).
I did create an 'fte' scheme, so fte://data/* reads files from quake's filesystem, fte://ssqc/* fte://csqc/* fte://menu/* will invoke the Cef_GeneratePage qc function to generate page requests (make requests to your qc if you feel like doing so, maybe in conjunction with uri_unescape).
You should also be able to call window.fte_query("getstats", function(req,ret){alert(ret);}); and get a list of stats. getseats, getserverinfo, getplayers should also work. note the delay.
I didn't bother testing most of this stuff so probably half of it is broken. Enjoy.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: FTE + WEB browsing = libCEF or Berkelium

Postby toneddu2000 » Sun Sep 03, 2017 9:37 pm

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: FTE + WEB browsing = libCEF or Berkelium

Postby Spike » Mon Sep 04, 2017 12:35 am

gecko_navigate(GECKO_SHD,GECKO_URL);

you're doing that every single frame... equivelent to hitting refresh every single frame... so yeah, you get white (default background colour) because its too busy re-requesting the page.
call it just once, straight after gecko_create, or read the next paragraph.

gecko_create optionally takes two args. the second being the initial url (which won't change anything if the shader already exists).
basically it just registers a shader with a videomap line - gecko_create is actually just the same builtin as cin_open... webbrowsers, cinematics, the x11server plugin all implement the same internal video-decoding API, just that browsers provide input functions while media decoding provides stuff to seek.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: FTE + WEB browsing = libCEF or Berkelium

Postby toneddu2000 » Mon Sep 04, 2017 7:22 pm

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: FTE + WEB browsing = libCEF or Berkelium

Postby toneddu2000 » Wed Sep 06, 2017 4:58 pm

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: FTE + WEB browsing = libCEF or Berkelium

Postby Spike » Wed Sep 06, 2017 7:35 pm

normalised texture coords isn't the same as a normalised/unit vector.
really it just means you want:
//simplied IE_MOUSEABS
inputCursorOrg = [scanx, chary];

//drawing
void Gecko_Draw(vector gpos, vector gsize)
{
vector psize = (vector)getviewprop(VF_SCREENPSIZE); //query the current physical screen size
vector vsize = (vector)getviewprop(VF_SCREENVSIZE); //query the current virtual screen size
gecko_resize(GECKO_SHD, gsize_x * psize_x / vsize_x, gsize_y * psize_y / vsize_y); //tell the media decoder the actual size in pixels (or rather, texels) instead of virtual sizes (those come from the size arg of drawpic).
gecko_mousemove(GECKO_SHD, (inputCursorOrg_x-gpos_x)/gsize_x, (inputCursorOrg_y-gpos_y)/gsize_y); //report the mouse coords in terms of 0-1, instead of pixels or anything.
drawpic(gpos, GECKO_SHD, gsize, [1,1,1],1, 0); //draw the shader.
};


gecko_keyevent's return value isn't useful. don't bother with it (apparently fte doesn't even set it. hurrah for undefined values).

tracelines/getsurfacetexture only apply when it comes to shaders that are drawn on walls. note that mouse coords using 0-1 makes that part slightly simpler...

fte://data/index.html opens eg: id1/data/index.html
fte://somethingelse/whatever is not accepted. sandboxing or something.

Cef_GeneratePage allows you to dynamically generate html/whatever directly from QC. Useful for menus like showing available maps or other dynamic content.

Use the cef console command if you want a simple web browser. You get a url bar etc that way.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: FTE + WEB browsing = libCEF or Berkelium

Postby toneddu2000 » Wed Sep 06, 2017 9:49 pm

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: FTE + WEB browsing = libCEF or Berkelium

Postby Spike » Thu Sep 07, 2017 1:25 am

.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: FTE + WEB browsing = libCEF or Berkelium

Postby toneddu2000 » Thu Sep 07, 2017 8:13 am

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: FTE + WEB browsing = libCEF or Berkelium

Postby toneddu2000 » Thu Sep 07, 2017 11:41 am

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: FTE + WEB browsing = libCEF or Berkelium

Postby toneddu2000 » Thu Sep 07, 2017 1:20 pm

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: FTE + WEB browsing = libCEF or Berkelium

Postby toneddu2000 » Thu Sep 07, 2017 3:46 pm

- my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1395
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Next

Return to CSQC Programming

Who is online

Users browsing this forum: No registered users and 1 guest