captainbuckkets
captainbuckkets
DDeno
Created by captainbuckkets on 5/22/2024 in #help
Removing cookie for basic logout
This did previously work and somehow in the last week, its stopped functioning as it used to
4 replies
DDeno
Created by captainbuckkets on 10/19/2023 in #help
Installing a deno script
But using "export PATH="$HOME/.deno/bin:$PATH" made it accessable
5 replies
DDeno
Created by captainbuckkets on 10/19/2023 in #help
Installing a deno script
Even after installing it on the linux side for WSL, its not accessible from another directory
5 replies
DDeno
Created by captainbuckkets on 10/19/2023 in #help
Installing a deno script
Seems like it works on WSL but not on windows when deno is installed through chocolatey
5 replies
DDeno
Created by captainbuckkets on 1/29/2023 in #help
NPM Import results in Rust panic
Rather die than actually use NPM so will seek alternatives I guess
6 replies
DDeno
Created by captainbuckkets on 1/29/2023 in #help
NPM Import results in Rust panic
6 replies
DDeno
Created by captainbuckkets on 1/29/2023 in #help
NPM Import results in Rust panic
Will do. Noticed a few unwraps issues
6 replies
DDeno
Created by captainbuckkets on 12/21/2022 in #help
Deno SDL2 Default Text Render Example (FFI problem w 1.29)
I see. That seemed to resolve it. Still have inconsistent color results which is really odd
25 replies
DDeno
Created by captainbuckkets on 12/21/2022 in #help
Deno SDL2 Default Text Render Example (FFI problem w 1.29)
Interesting. Will try again tomorrow and see what it does
25 replies
DDeno
Created by captainbuckkets on 12/21/2022 in #help
Deno SDL2 Default Text Render Example (FFI problem w 1.29)
I did the encode and it did remove the null character but I see that as a serious concern. How then, can one draw font without those characters in a cross platform way? Also it did kinda seem that playing with the encoding of the test made the color application not stick to the font consistently
25 replies
DDeno
Created by captainbuckkets on 12/21/2022 in #help
Deno SDL2 Default Text Render Example (FFI problem w 1.29)
Now just to figure out how to draw a rect in SDL and copy the texture to it so its predictable
25 replies
DDeno
Created by captainbuckkets on 12/21/2022 in #help
Deno SDL2 Default Text Render Example (FFI problem w 1.29)
25 replies
DDeno
Created by captainbuckkets on 12/21/2022 in #help
Deno SDL2 Default Text Render Example (FFI problem w 1.29)
Okay so this
renderSolid(text: string, color: Color) {
try {
const encoder = new TextEncoder()
const buffer = encoder.encode(text);
const raw = sdl2Font.symbols.TTF_RenderText_Solid(
this[_raw],
buffer,
color[_raw],
);
return new Texture(raw);
} catch (error) {
console.log("error", error)
}
}
renderSolid(text: string, color: Color) {
try {
const encoder = new TextEncoder()
const buffer = encoder.encode(text);
const raw = sdl2Font.symbols.TTF_RenderText_Solid(
this[_raw],
buffer,
color[_raw],
);
return new Texture(raw);
} catch (error) {
console.log("error", error)
}
}
with
"TTF_RenderText_Solid": {
"parameters": ["pointer", "buffer", "pointer"],
"result": "pointer",
},
"TTF_RenderText_Solid": {
"parameters": ["pointer", "buffer", "pointer"],
"result": "pointer",
},
is acceptable and doesn't error out
25 replies
DDeno
Created by captainbuckkets on 12/21/2022 in #help
Deno SDL2 Default Text Render Example (FFI problem w 1.29)
I've changed every value in here to null and identified the text as the problem it seems
const raw = sdl2Font.symbols.TTF_RenderText_Solid(
this[_raw],
null, // asCString(text)
color[_raw],
);
const raw = sdl2Font.symbols.TTF_RenderText_Solid(
this[_raw],
null, // asCString(text)
color[_raw],
);
This will atleast not result in an error
25 replies
DDeno
Created by captainbuckkets on 12/21/2022 in #help
Deno SDL2 Default Text Render Example (FFI problem w 1.29)
25 replies
DDeno
Created by captainbuckkets on 12/21/2022 in #help
Deno SDL2 Default Text Render Example (FFI problem w 1.29)
Tried casting color and the pointer to BigInt and tried using TextEncoder but no change https://stackoverflow.com/questions/61813646/whats-deno-equivalent-of-node-js-buffer-fromstring
25 replies
DDeno
Created by captainbuckkets on 12/21/2022 in #help
Deno SDL2 Default Text Render Example (FFI problem w 1.29)
Could be either the this[_raw] or the Color since that might be being passed in as a pointer. Casting both using the asCString did not fix, nor did changing the type expectations in the relevant section
25 replies
DDeno
Created by captainbuckkets on 12/21/2022 in #help
Deno SDL2 Default Text Render Example (FFI problem w 1.29)
Very bad because that means it cant allocate enough
25 replies
DDeno
Created by captainbuckkets on 12/21/2022 in #help
Deno SDL2 Default Text Render Example (FFI problem w 1.29)
I tried to cast it as an array buffer but it said allocation failed
renderSolid(text: string, color: Color) {
try {
console.log("text", text, "color", color)
console.log(
"this[_raw]", this[_raw],
"asCString(text)", asCString(text),
"color[_raw]", color[_raw],
)
const pointer = this[_raw];
const buffer = new ArrayBuffer(pointer);
const raw = sdl2Font.symbols.TTF_RenderText_Solid(
buffer,
asCString(text),
color[_raw],
);
return new Texture(raw);
} catch (error) {
console.log("error", error)
}
}
renderSolid(text: string, color: Color) {
try {
console.log("text", text, "color", color)
console.log(
"this[_raw]", this[_raw],
"asCString(text)", asCString(text),
"color[_raw]", color[_raw],
)
const pointer = this[_raw];
const buffer = new ArrayBuffer(pointer);
const raw = sdl2Font.symbols.TTF_RenderText_Solid(
buffer,
asCString(text),
color[_raw],
);
return new Texture(raw);
} catch (error) {
console.log("error", error)
}
}
Error
error RangeError: Array buffer allocation failed
error RangeError: Array buffer allocation failed
25 replies
DDeno
Created by captainbuckkets on 12/21/2022 in #help
Deno SDL2 Default Text Render Example (FFI problem w 1.29)
Must be the this[_raw] since thats a Deno.UnsafePointer
25 replies