Opened 9 years ago

Closed 9 years ago

Last modified 6 years ago

#515 closed enhancement (fixed)

A simple gadget request

Reported by: beherith Owned by: Bluestone
Priority: minor Milestone:
Component: BAR Version:
Keywords: Cc:

Description (last modified by beherith)

I would like to request a gadget that does three things: It gets called init it gets called on viewresize And it has a single function that can be called from any unsynced gadget and any widget which returns a string.

I totally fail at the gadget interoperability, and have wasted a day and gotten nowhere with it :(

Any favor barter offers are welcome.

Change History (16)

comment:1 by beherith, 9 years ago

Description: modified (diff)

comment:2 by Bluestone, 9 years ago

Owner: set to Bluestone

I'll do it.

What string do you want it to return? And what do you mean by 'called' on view resize and init - where should it return to in these cases?

Last edited 9 years ago by Bluestone (previous) (diff)

comment:3 by beherith, 9 years ago

It will return a string that is a handle to a lua texture. It should just return to itself when called in resize and init, like a normal gadget.

comment:4 by beherith, 9 years ago

Aparrently, its ok if this is just a widget, too:

comment:5 by Bluestone, 9 years ago

I am lost here - the texture (and its 'string' identifier) is only valid within the lua state that it's created in, so it wouldn't help to know what that identifier was in another lua state unless you'd also sent the entire texture over.

I guess jKs Script.LuaUI solution works (didn't test it) and the fact that jK didn't use _G suggests that my _G solution won't, I guess because of the amount of data involved.

Do you have code that creates + binds the texture you're interested in? And then I can play with it and try and send it somewhere.

comment:6 by beherith, 9 years ago

function widget:GetInfo()
  return {
    name      = "Screencopy Manager",
    desc      = "Makes a copy of the screen to a texture to share to bloom, los and distortionfbo",
    author    = "Beherith",
    date      = "Nov 2013",
    license   = "GNU GPL, v2 or later",
    layer     = -1000000000,
    enabled   = true  --  loaded by default?

local screenTexture = nil
local vsx =0 
local vsy =0
local lastupdate = 0

local glCopyToTexture = gl.CopyToTexture
local glCreateTexture = gl.CreateTexture
local glDeleteTexture = gl.DeleteTexture
local spGetDrawFrame  = Spring.GetDrawFrame

function widget:Initialize()
	Spring.Echo('Welcome to the fx_screencopy_manager!')
	if glCopyToTexture == nil then
		Spring.Echo('Sorry you are screwed with no glCopyToTexture support')
	screenTexture = gl.CreateTexture(vsx,vsy, {
		min_filter = GL.LINEAR,
		mag_filter = GL.LINEAR,
		wrap_s   = GL.CLAMP_TO_EDGE,
		wrap_t   = GL.CLAMP_TO_EDGE,

function widget:ViewResize(viewSizeX, viewSizeY)
	vsx = viewSizeX
	vsy = viewSizeY
	if screenTexture then
	screenTexture = gl.CreateTexture(vsx,vsy, {
		min_filter = GL.LINEAR,
		mag_filter = GL.LINEAR,
		wrap_s   = GL.CLAMP_TO_EDGE,
		wrap_t   = GL.CLAMP_TO_EDGE,

function widget:GameFrame(n)
	if n>lastupdate+30 and screenTexture then

function GetScreenCopy()
	if screenTexture == nil then
		Spring.Echo('Creating new screenTexture')
	if lastupdate < spGetDrawFrame() then
		glCopyToTexture(screenTexture, 0, 0, 0, 0, vsx, vsy, nil,0)
	return screenTexture


comment:7 by Bluestone, 9 years ago

We can close this now, right?

comment:8 by Bluestone, 9 years ago

Resolution: fixed
Status: newclosed

fixed by [1910]

comment:10 by NormanMouff, 6 years ago

bb1964 eb8208 [url=]Cialis Pricesurl sy7103 sn2729rl106 <a href=" ">pharmacy from canada</a> jd4444sr1515fw5341 ed6692 nb3693 [url=]canada pharmacyurl hl3577

comment:11 by Jameshup, 6 years ago

fj9572 price of viagra <a href=" ">pharmacy from canada</a> zg5395 I am not my body. My body is nothing without me

comment:12 by Jameshup, 6 years ago

gz6271 information buy zithromax hf2841 [url=]Zithromax[/url] zithromax cheap for aa2361 <a href=" ">buy Zithromax</a> azithromycin offers br7202 What drains your pungency drains your body. What fuels your bent fuels your essence

comment:13 by Jameshup, 6 years ago

fa7997 levitra online purchase propecia <a href=" ">read more</a> ou6426 Before choosing healthy over half-starved you are choosing self-love to self-judgment. You are beautiful

comment:14 by eulane18, 6 years ago

Study my altered devise

mobogenie android games free download live wallpaper sexy girls download market application m market apk igo for android

live wallpaper adult erstes android smartphone app making my google play games download play market apk

comment:15 by shawnlk4, 6 years ago

Every day gay photos military talents

comment:16 by Brianswins, 6 years ago

xq8396 viagra online discount <a href=" ">generic viagra</a> qo5657 Via choosing salubrious as a remainder pinched you are choosing self-love over self-judgment. You are incomparable gh8637 buying cialis online <a href=" ">generic cialis</a> ke517 An over-indulgence of anything, all the same something as mere as unsound, can electrify

Note: See TracTickets for help on using tickets.