Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 14:51
    cmey commented #136
  • 14:18
    mosra closed #559
  • 14:18
    mosra commented #559
  • 14:01

    mosra on master

    Platform: port GlfwApplication … Platform: port EmscriptenApplic… Platform: port Sdl2Application … and 7 more (compare)

  • 13:08
    cmey commented #136
  • 13:07
    cmey commented #136
  • 13:07
    cmey commented #136
  • 12:40
    Build #3898 passed
  • 12:02
    Squareys synchronize #137
  • 11:41
    Squareys opened #137
  • 11:40
    mosra commented #136
  • 11:40
    mosra commented #135
  • 11:33
    cmey commented #135
  • 11:24
    cmey commented #135
  • 11:23
    cmey commented #135
  • 10:51
    mosra commented #135
  • 09:53
    cmey commented #135
  • 09:53
    cmey commented #135
  • 09:52
    cmey commented #135
  • 09:46
    cmey edited #135
Fo Nz
@FoNz99089892_twitter

I remember having to do the same thing and ended up copying most of the androidapplication class and modifying it. @mosra if you might be able to take this into androidapplication, would be great

This is fine, but you should destroy the old resources, like the GL Surface, when re-creating the new one, otherwise you will result in a memory leak!

Fo Nz
@FoNz99089892_twitter
I have done it! Keep the GL Context in memory on Android is definitely possible! I would borrow the code from @hsdk123 with the eglDestroySurface on the old surface, when the app requires a new surface.
OptimusLime
@OptimusLime
Howdy, long time lurker, I am experiencing some build issues that I've tried to track down for quite a few hours. The issue doesn't appear if I clone magnum into a folder and cmake add_subdirectory(... EXCLUDE_FROM_ALL). However, if I use Cmake "FetchContent" to clone the github repo, then when I build I get a whole bunch of errors like this:
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(53,66): warning C4346: 'Magnum::Math::IsScalar<T>::value': dependent name is not a type [C:\coding\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(53,66): message : prefix with 'typename' to indicate a type [C:\coding\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(53,82): error C2146: syntax error: missing ')' before identifier 'value' [C:\coding\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(53,82): error C2365: 'T': redefinition; previous definition was 'template parameter' [C:\coding\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(53): message : see  declaration of 'T' [C:\coding\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(53,82): error C2061: syntax error: identifier 'value' [C:\coding\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(53,19): error C2059: syntax error: ')' [C:\coding\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(53,82): error C2146: syntax error: missing ')' before identifier 'min' [C:\coding\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(53,82): error C2146: syntax error: missing ';' before identifier 'min' [C:\coding\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(53,102): error C2143: syntax error: missing ';' before '{' [C:\coding\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(53,102): error C2447: '{': missing function header (old-style formal list?) [C:\coding\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(56,66): warning C4346: 'Magnum::Math::IsScalar<T>::value': dependent name is not a type [C:\Users\paul\coding\neurite\frontiers\scratch\sdlcs_helloworld_multiplatform\plugins\mag-plugin-node-api\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(56,66): message : prefix with 'typename' to indicate a type [C:\coding\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(56,82): error C2146: syntax error: missing ')' before identifier 'value' [C:\coding\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(56,82): error C2365: 'T': redefinition; previous definition was 'template parameter' [C:\Users\paul\coding\neurite\frontiers\scratch\sdlcs_helloworld_multiplatform\plugins\mag-plugin-node-api\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(56): message : see declaration of 'T' [C:\coding\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(56,82): error C2061: syntax error: identifier 'value' [C:\coding\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(56,19): error C2059: syntax error: ')' [C:\coding\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(56,82): error C2146: syntax error: missing ')' before identifier 'max' [C:\coding\build\plugin-node-api.vcxproj]
C:\coding\build\_deps\magnum-src\src\Magnum/Math/Vector.h(56,82): error C2146: syntax error: missing ';' before identifier 'max' [C:\coding\build\plugin-node-api.vcxproj]
FetchContent simply clones into a directory build/_deps/magnum-src and then builds to build/_deps/mangum-build. Nothing special. Any ideas on why this might be happening?
Vladimír Vondruš
@mosra
on line 53 there's a definition of a min() function
so i have a hunch that this has something to do with windows.h and the insane macros there
build with #define NOMINMAX? :)
in all places in magnum where i'm including windows.h i'm defining this, so this is probably due to your code (or a 3rd party lib used by your code) including windows.h without defining NOMINMAX first
OptimusLime
@OptimusLime
I just got back to the computer. Wow, that did it! I can't thank you enough, that was so difficult to track down.
Innokentiy Alaytsev
@Innokentiy-Alaytsev
IMHO, the best solution is to define NOMINMAX globally for the entire project through CMake target property (target_compile_definitions or something). In theory, Magnum could do that the same way and make in PUBLIC. The latter has the downside of being totalitarian.
OptimusLime
@OptimusLime
I did it through "add_compile_definitions(NOMINMAX)" in CMake. Is this a pretty common error case when getting started with Magnum and Windows?
hsdk123
@hsdk123
Hey all, referring back to my question on the phong shader - would anyone know what might be happening?
Vladimír Vondruš
@mosra

Is this a pretty common error case when getting started with Magnum and Windows?

@OptimusLime you'd hit this whenever there's a variable or a function defined min or max anywhere, so i wouldn't say this is specific to Magnum, even the standard <limits> header has issues with this ... so i'd say dealing with NOMINMAX is a common Windows practice? (not a Windows user myself tho)

@hsdk123 sorry, forgot to reply :) i have some ideas:
  • the red window blinds are also a Phong shader? or something different
  • could it be some uninitialized variable that's just lucky to be non-zero on emscripten/desktop but is zero on the phone?
  • what all features do you enable for it? is it textured (is it possible that it's referencing some uninitialized texture)?
  • if you set the ambient color to something non-black, does anything change?
  • if not, does anything change if you set light count to 0?
  • if you enable GL debug output on the (android) phone, do you get any messages / errors? or, in case of iOS, the GL debugger in Xcode?
  • is the ANGLE translation layer involved in this or are you running directly on device GL drivers?
hsdk123
@hsdk123

@mosra

the red window blinds

This is just the clear colour coming through.

angle

On windows it's angle, and then for browser it's emscripten. The windows + emscripten outputs are the same (The model shows with shading). The ios + android outputs are the same (model doesn't show)

I'll try think on the other points!
Jordan Peck
@Auburn
Just to let you know, MSVC 2022 still requires MSVC2019_COMPATIBILITY to compile
Vladimír Vondruš
@mosra
is it out already?
or is it still a preview?
Jordan Peck
@Auburn
Preview 4 just came out, I was testing that
Vladimír Vondruš
@mosra
appveyor/ci#3712 subscribed to this issue, i'll look at it once i can test on AppVeyor
and i guess i'll drop MSVC 2015 then, nobody hopefully uses that anymore :D
Guillaume Jacquemin
@williamjcm

Dunno if it's a Corrade or C++ issue (leaning towards the latter), but I got something weird today.

I have a growable Array containing Pointer<Base>s to take advantage of polymorphism.

I tried doing arrayAppend(array, pointer<Derived>(args)), but the compiler rejected it.

However, Pointer<Base> p = pointer<Derived>(args) followed by arrayAppend(array, p) is fine.

Vladimír Vondruš
@mosra
and i suppose arrayAppend with InPlaceInit works, right?
Guillaume Jacquemin
@williamjcm
It's a possibility, but I forgot to try it.
Vladimír Vondruš
@mosra
i hit this a few times myself as well, it boils down to a conflict in template type
the signature should be arrayAppend(Array<T>&, const std::common_type<T>::type&) instead of arrayAppend(Array<T>&, const T&) and then it would work i think
Guillaume Jacquemin
@williamjcm

and i suppose arrayAppend with InPlaceInit works, right?

Yup.

Vladimír Vondruš
@mosra
i am useless today anyway, so i could as well just go and fix that
Guillaume Jacquemin
@williamjcm
Ah, I just saw you finally implemented your own Pair type. :)
Been a while since I last took a glance at the sidebar in Gitter.
Vladimír Vondruš
@mosra
and a Triple :D
Pair is there for quite a while, Triple since now
i hope i'll never need a Quadruple
mosra/corrade@34a53fa should be the fix
once the CI gods approve
Guillaume Jacquemin
@williamjcm
It'll give me an excuse to upgrade my current project's dependencies.
Vladimír Vondruš
@mosra
i guess i could do also arrayInsert() and arrayRemove() while at it
Guillaume Jacquemin
@williamjcm
I haven't updated Corrade or Magnum since I added them as submodules in early June.
At the same time, I haven't really needed any of the new stuff.
Guillaume Jacquemin
@williamjcm

i guess i could do also arrayInsert() and arrayRemove() while at it

Now that I think about it, while I won't need arrayInsert(), arrayRemove() will be useful.

While I could do std::remove_if() combined with arrayRemoveSuffix(), it's a bit too long just to remove single elements.

Jamil Halabi
@jay3d
Installing magnum on linux with vcpkg is failing
CMake Error at scripts/cmake/vcpkg_from_github.cmake:164 (message):
  Failed to parse API response from '':



  {

    "ref": "refs/heads/master",
    "node_id": "MDM6UmVmMjg2MzkwOTpyZWZzL2hlYWRzL21hc3Rlcg==",
    "url": "https://api.github.com/repos/mosra/corrade/git/refs/heads/master",
    "object": {
      "sha": "34a53fab11928765f5fb2704b5653769a20b63a5",
      "type": "commit",
      "url": "https://api.github.com/repos/mosra/corrade/git/commits/34a53fab11928765f5fb2704b5653769a20b63a5"
    }

  }



Call Stack (most recent call first):
  ports/corrade/portfile.cmake:1 (vcpkg_from_github)
  scripts/ports.cmake:140 (include)
Vladimír Vondruš
@mosra
errrrr
doesn't sound like my problem, tho
Jamil Halabi
@jay3d
Yes I think it's a problem getting head packages from vcpkg on linux
Vladimír Vondruš
@mosra
from 19th August, lol
microsoft/vcpkg#19657 seems to be a candidate for a fix and/or introducing other bugs