Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411419 Posts in 69363 Topics- by 58416 Members - Latest Member: timothy feriandy

April 17, 2024, 07:35:48 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)General thread for quick questions
Pages: 1 ... 51 52 [53] 54 55 ... 69
Print
Author Topic: General thread for quick questions  (Read 134396 times)
qMopey
Level 6
*


View Profile WWW
« Reply #1040 on: April 01, 2017, 10:56:11 AM »

Why do you need a file system? I just use this: https://github.com/RandyGaul/tinyheaders/blob/master/tinyfiles.h

Not a file system thing, but has very useful abstraction for looping over files and folders. What more would anyone want?
Logged
JWki
Level 4
****


View Profile
« Reply #1041 on: April 01, 2017, 11:03:01 AM »

I just use the Win32 stuff mostly for file system stuff but tell me how you like boost's version I'm interested in a cross platform solution too.
Logged
qMopey
Level 6
*


View Profile WWW
« Reply #1042 on: April 01, 2017, 11:04:45 AM »

I just use the Win32 stuff mostly for file system stuff but tell me how you like boost's version I'm interested in a cross platform solution too.

Seconded. I used to just win32 stuff, but then eventually wrote Posix things too for more cross-platform. So why would anyone want to use Boost or something similar?
Logged
oahda
Level 10
*****



View Profile
« Reply #1043 on: April 01, 2017, 11:13:13 AM »

I don't just need to traverse files, but also move and copy files, get the current directory and so on. I'd use cstdio and dirent if that was enough, but in this case, it seems not to be. :c

Of course I could write a simple wrapper for good old system() to do stuff on the command line in UNIX and Windows respectively, but I want a bit of comfort too. Thanks anyhow!

Anyway, got the Boost lib working, so will be trying that now. c: It's just a small standalone command line utility I'm writing up quickly, so the code doesn't need to be perfect, and it'll be small enough that I'll probably just quickly rewrite it with the C++17 lib when that's possible anyway.
Logged

JWki
Level 4
****


View Profile
« Reply #1044 on: April 01, 2017, 12:02:54 PM »

Well yeah you can always write a wrapper for the OS API I guess but that's somewhat daunting to do for all 3 platforms.
Logged
Sik
Level 10
*****


View Profile WWW
« Reply #1045 on: April 02, 2017, 01:53:59 AM »

What's annoying is that POSIX already handles this (and that's like effectively an alternate standard library). Yeah it's C, but it wouldn't take much effort to wrap it in C++. It's pretty much standard on anything *nix, it would be nice if Windows actually adopted it =/ (the basic directory functionality is actually there inherited from Windows NT, but it expects ASCII filenames from what I recall)
Logged
oahda
Level 10
*****



View Profile
« Reply #1046 on: April 02, 2017, 02:39:44 AM »

Well, C++17 is going to have you covered, so look forward to it. c:

Enjoying the boost lib so far. Only issue I found is that it doesn't have a build in function to make deep copies of folders, so I had to recurse manually, but all the necessary functionality to do so is there, and that's a function written once (or in this case, copied from someone online who had already done the work) and then used over and over, so not too bad. Do hope the STL version will provide it, tho, since it seems like a reasonably common use case to me.
Logged

qMopey
Level 6
*


View Profile WWW
« Reply #1047 on: April 02, 2017, 01:48:47 PM »

What's annoying is that POSIX already handles this (and that's like effectively an alternate standard library). Yeah it's C, but it wouldn't take much effort to wrap it in C++. It's pretty much standard on anything *nix, it would be nice if Windows actually adopted it =/ (the basic directory functionality is actually there inherited from Windows NT, but it expects ASCII filenames from what I recall)

Nothing is stopping anyone from writing a posix wrapper for the Windows APIs Smiley
Logged
Sik
Level 10
*****


View Profile WWW
« Reply #1048 on: April 02, 2017, 09:02:11 PM »

Yeah, I'm just more annoyed at how the solution was already there for a long while but it's useless in many cases due to bad support in one huge major platform. Reminds me of how stdint.h had to be avoided like the plague (or provide your own) because Visual Studio didn't come with one until a few years ago.

To be fair though no idea how all this fares on mobile. They try to discourage you from writing portable code to the furthest extent they can get away with.
Logged
qMopey
Level 6
*


View Profile WWW
« Reply #1049 on: April 03, 2017, 10:02:10 AM »

Yeah I think that's mostly Apple to blame. Apple is the most proprietary company I have ever seen in terms of code and APIs. It's ridiculous. Not a big wonder why most games are still played on Windows.
Logged
oahda
Level 10
*****



View Profile
« Reply #1050 on: April 03, 2017, 10:32:27 AM »

huh, for me mac and linux dev has always been basically the same thanks to their common unix core, while windows and mvsc has been the weird one out d:
Logged

qMopey
Level 6
*


View Profile WWW
« Reply #1051 on: April 03, 2017, 10:41:24 AM »

On Apple applications are launched from Objective-C. Proprietary language  No No NO  Lots of posix pieces are missing and still platform specific. For example just getting time on Apple machines almost uses a posix API, but diverges into that mach_time stuff. Also, Xcode? Code signing? Need I say more?

 Screamy Screamy Screamy

At least Linux and Windows both allow the programmer to stick strictly to C. For example in my own game the only differences between Linux/Windows so far is file handling and threading. Oh and some tiny netcode differences (WSA startup stuff). But with xcode there are tons of annoying things. Like where is the working directory on Apple machines? Oh it's in some random weird folder (at least when using xcode), so that will have to be changed to the executable's directory.
« Last Edit: April 03, 2017, 10:47:56 AM by qMopey » Logged
oahda
Level 10
*****



View Profile
« Reply #1052 on: April 03, 2017, 11:32:09 AM »

I really don't ever touch Objective-C since I'm writing cross-platform C++ using libraries that abstract any of it away anyway, so you really don't have to go there unless you actually want to do everything from scratch for some reason. c:

My taking a look at NSTask was quite exceptional, and in the end I used a C++ lib anyway. But any use of it doesn't really bother me since it's so seamless thanks to the Objective-C++ compiler that allows files with mixed code that can share everything that both languages inherited from C, like primitives and pointers. Trying out NSTask required no additional setup in my C++ project, and I just stuck it in the middle of a C++ function. ε:

(also modern C++ STL is bridging a lot of gaps that used to be there, like threading, which is nice (but even before that, third-party solutions of course existed))

But each to their own! Tongue It's all habit in the end.
Logged

oahda
Level 10
*****



View Profile
« Reply #1053 on: April 05, 2017, 02:01:03 AM »

Considering using something like Qt for my editor after all, solely on the basis of highly valuing good localisation and proper Unicode support and text rendering, no matter if it's left-to-right Mandarin with one constant glyph for each codepoint or right-to-left Arabic with lots of ligatures and contextual glyphs and diacritics. I'm not sure, but I can't imagine ImGui handles all these use cases very well.

But I will also need this solved for the OpenGL game itself eventually. So is there already a solution out there? I feel like there must be...

Maybe this? Found some info too, so I think I'll give it a try.
« Last Edit: April 05, 2017, 02:20:10 AM by Prinsessa » Logged

ferreiradaselva
Level 3
***



View Profile
« Reply #1054 on: April 05, 2017, 05:12:18 AM »

Pango and Cairo are already used in Gtk(2/3) applications. They definitelly have the best implementations to render text out there (including for eastern languages), *however*, they are bulky libraries. Also, be aware that they are LGPL libraries, so if you want to allow closed-source derivatives of your project, you must link to them dynamically.
Logged

JWki
Level 4
****


View Profile
« Reply #1055 on: April 05, 2017, 07:19:19 AM »

Considering using something like Qt for my editor after all, solely on the basis of highly valuing good localisation and proper Unicode support and text rendering, no matter if it's left-to-right Mandarin with one constant glyph for each codepoint or right-to-left Arabic with lots of ligatures and contextual glyphs and diacritics. I'm not sure, but I can't imagine ImGui handles all these use cases very well.

But I will also need this solved for the OpenGL game itself eventually. So is there already a solution out there? I feel like there must be...

Maybe this? Found some info too, so I think I'll give it a try.

I might be somewhat opinionated, probably also because I'm in a lucky spot where I never needed software to be localized for me simply because most software is in English, but is full localization support really that valuable for tools?
I can get behind text rendering being incredibly important, you want free scaling and crisp glyphs for tools to be usable, but unless you plan on releasing your tools as a part of your game I guess I wouldn't bother with localization too much?

For the game itself of course, being able to render all sorts of fonts is desirable but I don't know if there's any games that actually handle text rendering that well.
Logged
ferreiradaselva
Level 3
***



View Profile
« Reply #1056 on: April 05, 2017, 09:17:59 AM »

I agree with that. For tools, english is enough. The user will need to understand english anyway to write the code. For games, that's another story.
Logged

oahda
Level 10
*****



View Profile
« Reply #1057 on: April 05, 2017, 09:35:39 AM »

Don't necessarily intend on localising the tool itself, but the games very much so, and I do want to have tools to localise the game within the editor for example, and to enter things like names of authors no matter the language/script, so it's still necessary for me.

So Pango/Cairo is going semi-well. It's fundamentally working, but combining diacritics mess things up no matter the script.

So these Arabic and Devanagari words without diacritics are fine:



But these with them are not:



Both Pango and Cairo are the latest version (I even tried switching Cairo from stable to devel). It doesn't seem to be a fundamental flaw tho, because it seems to work for many other people, so I must be getting something wrong locally. Can't figure it out...

(it's not the font)
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #1058 on: April 05, 2017, 01:11:13 PM »

That's pretty though
Logged

oahda
Level 10
*****



View Profile
« Reply #1059 on: April 05, 2017, 01:16:59 PM »

Yeah, I'm using the Amiri font. ε:
Logged

Pages: 1 ... 51 52 [53] 54 55 ... 69
Print
Jump to:  

Theme orange-lt created by panic