Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1412064 Posts in 69447 Topics- by 58483 Members - Latest Member: Exye

June 24, 2024, 07:54:23 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)General thread for quick questions
Pages: 1 ... 66 67 [68] 69
Print
Author Topic: General thread for quick questions  (Read 138291 times)
InfiniteStateMachine
Level 10
*****



View Profile
« Reply #1340 on: November 21, 2019, 07:41:25 AM »

Thanks for all the advice! Smiley

I'm kind of looking forward to working on something graphical without using a heavy weight engine.
Logged

qMopey
Level 6
*


View Profile WWW
« Reply #1341 on: November 21, 2019, 01:19:52 PM »

Just echoing the others -- you can initialize only the parts in SDL2 that you like. You don't need a graphics context, or the audio driver to be initialized, or anything really.

The minimum would be the window and the input system.

Flags for creating a window here, just omit the OPENGL flag: https://wiki.libsdl.org/SDL_WindowFlags
Events here, omit all other flags: https://wiki.libsdl.org/SDL_Init#Remarks

And then it's pretty much a GLFW clone. But with better Steam compatibility and more supported platforms, and more features if you decide to want them later. IMO GLFW doesn't really have a competitive advantage over SDL2, and I think the SDL2 docs are better.
Logged
Schrompf
Level 10
*****

C++ professional, game dev sparetime


View Profile WWW
« Reply #1342 on: November 21, 2019, 11:14:08 PM »

Thanks for the infos! This adds a new point to my ToDo-List. Porting to SDL2.
Logged

Snake World, multiplayer worm eats stuff and grows DevLog
InfiniteStateMachine
Level 10
*****



View Profile
« Reply #1343 on: November 22, 2019, 05:43:47 PM »

Looks like I'm gonna give SDL2 a try. I totally forgot I really need audio support since part of the tool is auditioning and editing audio files haha.

Not a fan of having to use Cmake for a hobby project but I suppose it's nearly unavoidable with a project that supports so many platforms. Just gotta make it over the initial build pain then I'm good Smiley

EDIT: Nevermind! They were kind enough to provide a pre-generated visual studio project so all I had to do was hit compile and I'm good.
« Last Edit: November 22, 2019, 05:54:44 PM by InfiniteStateMachine » Logged

oahda
Level 10
*****



View Profile
« Reply #1344 on: November 28, 2019, 07:31:04 AM »

Having an SDL2_net/Android networking issue… Doesn't hurt to ask here too. x:

https://twitter.com/avaskoog/status/1200056426103791616

Quote
Any idea why SDL2_net as client fails (w empty err!) to resolve host on Android device when internet permission is set in manifest and it works fine on e.g. iPhone? Same host+port (did try others too) and DID work last year. New router etc but again does work on iOS…

Given the circumstances I feel like it might be more about settings on the device than anything in my code…
Logged

Daid
Level 3
***



View Profile
« Reply #1345 on: November 28, 2019, 07:42:00 AM »

The SDL2_net code uses gethostbyname to do the lookup, so check hstrerror()?
http://man7.org/linux/man-pages/man3/gethostbyname.3.html

Also, gethostbyname is quite dated. "getaddrinfo" is a much better function, as it gives multiple results for both ipv4 and ipv6.
I have a bunch of code that seems to be much more complete then SDL2_net:
https://github.com/daid/SeriousProton2/tree/master/src/io/network
Logged

Software engineer by trade. Game development by hobby.
The Tribute Of Legends Devlog Co-op zelda.
EmptyEpsilon Free Co-op multiplayer spaceship simulator
oahda
Level 10
*****



View Profile
« Reply #1346 on: November 28, 2019, 09:12:10 AM »

Thanks! At least I got an error message now: unknown host. Not a lot but it seemed to have helped me exclude possibilities and focus my searching a bit more and I think I figured it out…

This link describes IP version issues regarding DNS resolution on later versions of Android.

Decided to just resolve the IP on the server and pass that instead of the host name to the client when starting it up (it's for a debug setup on a local network, so the server can just pass it with the command line arguments when starting up the client).

Did the trick anyhow! Tears of Joy
Logged

oahda
Level 10
*****



View Profile
« Reply #1347 on: November 29, 2019, 08:45:11 AM »

Got another one…

Trying to get arguments into the Emscripten-compiled web build of my program (argc/argv). Everything I can find online points to adding an array member to the JavaScript Module object called arguments and pushing the values to it and it should work. But… I can't get it to work.

I'm using the shell.html from Emscripten itself, which declares a var Module with some stuff in it. I tried adding the arguments array to that. But my argc remains 0 and my argv remains null. ):
Logged

Daid
Level 3
***



View Profile
« Reply #1348 on: November 29, 2019, 01:35:37 PM »

You sure you set them soon enough? Some module parameters can be set at any time, some must be set before anything else is initialized. (As is common in javascript land, it's badly documented at best)
Logged

Software engineer by trade. Game development by hobby.
The Tribute Of Legends Devlog Co-op zelda.
EmptyEpsilon Free Co-op multiplayer spaceship simulator
oahda
Level 10
*****



View Profile
« Reply #1349 on: November 29, 2019, 01:41:45 PM »

I've even tried hardcoding some directly into where Module first gets defined and even those don't get sent in. ):

That is, like so:

Code:
var Module = {

arguments: ['test', 'hello'],

};

I've also tried doing it in prerun(), but no luck there either. The callback itself works fine, as do all the others that I've been using for a long time, what to do on error and so on.
Logged

oahda
Level 10
*****



View Profile
« Reply #1350 on: February 07, 2020, 07:36:47 AM »

Am I missing something or does Im3d not have a way to set the size and position of the viewport the way ImGuizmo does, to make it easy to integrate with an editor viewport rather than a fullscreen one?

Also is there any way to check in ImGui if any or the current window/dock is currently being resized (splitter or whatever in drag state), whether the mouse is moving or not?
« Last Edit: February 07, 2020, 09:55:19 AM by Prinsessa » Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #1351 on: March 07, 2020, 06:17:37 PM »

SO about hairtech and tracing wrapping space ...

I find this mathematical problem that solve it for a similar problem, but I can't translate it into something I can understand (ie code) Can someone help me? I have been stuck on eon, and I feel like it should be possible lol

https://amininima.wordpress.com/2013/05/27/the-laser-gun/

If I Can get to have that equation properly to trace any primitive, I'm literally almost done!

All I can do is intersect an infinitely small point on the boundary of the space Sad I didn't generalized
Logged

oahda
Level 10
*****



View Profile
« Reply #1352 on: July 28, 2020, 01:46:14 PM »

Does anybody know of a way in macOS to get clang not to hog all the CPU while building? I'm fine with it taking a bit longer if the computer doesn't go bananas every time I build something a bit bigger. I've heard about (re)nice but there doesn't seem to be an easy way of using that to automatically downprioritise every instance of clang Xcode spins up in parallel. A setting in Xcode perhaps? Haven't had any luck searching online.
Logged

ArtInkStudios
Level 0
**


Art Ink Studio Logo


View Profile WWW
« Reply #1353 on: October 24, 2020, 09:12:19 AM »

I've created an invisible force field for a project for the first time, and I have already made a shader for it in Unity. I do not know how to create a C# script and found one for JavaScript, but will not work on unity 2020. Can anyone show me how to create one?
Logged
gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #1354 on: November 10, 2022, 12:20:12 PM »

Someone know if srgb can influence data from shader? when I save to texture then read back?
Logged

SammyClammy
Level 0
*


View Profile
« Reply #1355 on: December 13, 2022, 05:11:46 PM »

I am currently working on a Text Based game in Twine, and I really wanna bring some more vibrancy into the world. Is there any way to make background images in the engine, instead of having the same old black background image. The help is appreciated!  Hand Shake Left Hand Shake Right
Logged
oahda
Level 10
*****



View Profile
« Reply #1356 on: December 17, 2022, 07:21:48 AM »

I am currently working on a Text Based game in Twine, and I really wanna bring some more vibrancy into the world. Is there any way to make background images in the engine, instead of having the same old black background image. The help is appreciated!  Hand Shake Left Hand Shake Right

I've only used Twine once for a recent game jam so I'm no expert, but basically since it runs in the browser, it allows you to do things like this the same way you would on a web page, with some CSS.

Good explanation here:

Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #1357 on: January 31, 2023, 09:32:27 PM »

I'm trying to find the intersection between 2 functions:

1. ax+b
2. (x%1 -0.5)² + (y%1 -0.5)² < 0.1    OR just    (x%1 -0.5)² + (y -0.5)² < 0.1

can someone help?
« Last Edit: January 31, 2023, 09:59:00 PM by gimymblert » Logged

ProgramGamer
Administrator
Level 10
******


aka Mireille


View Profile
« Reply #1358 on: February 01, 2023, 07:27:02 PM »

Are those modulos or divisions?
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #1359 on: February 02, 2023, 12:29:07 PM »

Modulo

I did make some breakthrough visually (adding the horizontal that display the circles "extant") to help narrow the solution (by skipping "empty space"). The idea is:
- that ray circle intersections can be reduced to checking a range in perpendicular lines going through the circle centers,
- and in this case, I put those into an "infinite box" (the horizontal line)
- it's as good as checking if the box defined by the ray entrance and exit (vertical) overlap with one or many perpendicular.
- these perpendicular being spaced on "integer +.5", it's has good as saying if the interval contain some "integer +.5 and some padding" for the projected width of the perpendicular.
- these box happen at regular interval, so I need to find the relative movement (as if the box ray was stationary and unique) of the perpendicular to find when there will be overlap.
- Now if only I could put that in number and math.

Currently reading and not yet processing:
https://fgiesen.wordpress.com/2015/09/24/intervals-in-modular-arithmetic/
https://en.wikipedia.org/wiki/Moir%C3%A9_pattern
https://en.wikipedia.org/wiki/Vernier_scale
https://en.wikipedia.org/wiki/Beat_(acoustics)
https://www.mathpages.com/home/kmath161/kmath161.htm

But that wouldn't be a quick question anymore.

It's one of these case where you are desperate for a lead, but as soon as you ask, you get a new insight out of nowhere. Of course asking without being desperate first don't work, and waiting for desperation to ask the question don't either. I hate this curse.

It's funny because I rated the problem impossible at first, but I keep finding partial answer. I can solve the case where the delta of the ray wrapping vertically is smaller than the delta of the perpendicular (it's the projected distance between the two, because the ray can't "jump over" the projected range of the circle perpendicular. Now I can get the first hit if the box method overlap before the ray wrap vertically, but if the ray miss the box, I need to figure out that one.
Logged

Pages: 1 ... 66 67 [68] 69
Print
Jump to:  

Theme orange-lt created by panic