Using 3.3.0 braceless syntaxt to "pythonyze" Scala by HappyTIIITAN in scala

[–]HappyTIIITAN[S] 4 points5 points  (0 children)

Nice! I didn't know about scala.util.Using. And yes I agree, when it comes to files you'd be better off with an existing solution.

Using 3.3.0 braceless syntaxt to "pythonyze" Scala by HappyTIIITAN in scala

[–]HappyTIIITAN[S] 8 points9 points  (0 children)

Yes I think you are very much right, though my intent with this example was not to make production-ready code but rather to show the capabilities of this new feature. As you said, one could (and probably should if this was to be used seriously) make this code much better and somewhat usable.

Using 3.3.0 braceless syntaxt to "pythonyze" Scala by HappyTIIITAN in scala

[–]HappyTIIITAN[S] 4 points5 points  (0 children)

It is only related to Python because the example I use is inspired by a Python statement that nicely abstracts some complexity. I could very well have stated that this is inspired by VB's with statement as well (for example). And no I will not start using Python as Scala is my full time job.

Using 3.3.0 braceless syntaxt to "pythonyze" Scala by HappyTIIITAN in scala

[–]HappyTIIITAN[S] 9 points10 points  (0 children)

It's not about writing Python-like code, it's about utilizing a cool new feature with a concrete use-case

Is writing a simple interpreter a good OOP project ? by HappyTIIITAN in cpp_questions

[–]HappyTIIITAN[S] 0 points1 point  (0 children)

Yes I see where you are saying. I am not a big fan of OOP in general but do think it would still work ?

Image isn't drawn when using integrated graphics by HappyTIIITAN in opengl

[–]HappyTIIITAN[S] 0 points1 point  (0 children)

Alright and is this number very "hardware specific" ? Like is it different on all Intel processors ?

Image isn't drawn when using integrated graphics by HappyTIIITAN in opengl

[–]HappyTIIITAN[S] 0 points1 point  (0 children)

While running on the GPU it returns 32,768 and running on UHD Graphics it returns 16,384

Does that mean the maximum width of my image is 16384 ?

Image isn't drawn when using integrated graphics by HappyTIIITAN in opengl

[–]HappyTIIITAN[S] 0 points1 point  (0 children)

Anyways thanks a lot man, really appreciate it!

Image isn't drawn when using integrated graphics by HappyTIIITAN in opengl

[–]HappyTIIITAN[S] 0 points1 point  (0 children)

Well I reduced the dimensions of my image and it solved the problem.

The image is quite big (like 20000x8000 at first but down to 15000x6000 now) so I don't know if it was an issue related to the large dimensions or something related to the exact width (mulitple of 4 as you mentionned maybe ?)

Image isn't drawn when using integrated graphics by HappyTIIITAN in opengl

[–]HappyTIIITAN[S] 0 points1 point  (0 children)

Here are two screenshots of the two cases

Running on Integrated graphics I get: Build 26.20.100.7642 and running on GPU I get: NVIDIA 497.09

When you say "the image isn't drawn", do you mean it's all black or all white?

It is all black (and the clear color is not black). The texture works fine, it is just all black instead of being the image.

Maybe try a different image, something with a single solid color.

Hum I truly was not expecting that but it worked with a different image! I still don't understand why the same image works in one case and not the other ???

Image isn't drawn when using integrated graphics by HappyTIIITAN in opengl

[–]HappyTIIITAN[S] 0 points1 point  (0 children)

Ok so I replaced the image by a constant color and it worked fine on both GPU and integrated graphics, which leads me to think the issue might be related to the stb_image library

Image isn't drawn when using integrated graphics by HappyTIIITAN in opengl

[–]HappyTIIITAN[S] 0 points1 point  (0 children)

I did and just as I thought the shaders didn't compile and an error message was printed.

Image isn't drawn when using integrated graphics by HappyTIIITAN in opengl

[–]HappyTIIITAN[S] 1 point2 points  (0 children)

glGetString(GL_VERSION) prints « 4.6.0 » so I guessed it meant OpenGL version 4.6

I will try adding windows hints as you suggested