Comments (47)
Did you tried to remove Style.HighDPI
and pass only Style.OpenGL | Style.Shown
to the Window?
Would be nice if you could show me your code. Do you change the window size somehow?
from dgame.
Seems related to this SDL issue: http://forums.libsdl.org/viewtopic.php?t=9576&sid=090b706304f1829218c9c0f6887cce86
from dgame.
Thanks, I am completely new to Dgame and was following the tutorials so I didn't know about that. Style.OpenGL works fine, but Style.Shown and Style.HighDPI crash the process. Is that a bug?
$ dub
Target derelict-util 2.0.0 is up to date. Use --force to rebuild.
Target derelict-sdl2 1.9.5 is up to date. Use --force to rebuild.
Target derelict-gl3 1.0.12 is up to date. Use --force to rebuild.
Target dgame 0.5.3 is up to date. Use --force to rebuild.
Building dungeon ~master configuration "application", build type debug.
Compiling using dmd...
Linking...
Running ./dungeon
SDL version: 2.0.3
Error executing command run:
Program exited with code -11
Here is the code
https://gist.github.com/JackStouffer/77f0843449a211e76614
from dgame.
Also, changing the window call in that code to
Window wnd = Window(640, 480, "Dgame Test", Window.Style.OpenGL, GLSettings(0, 0, 2));
crashes the process as well
from dgame.
It shouldn't crash at all, but in your last example it crashes because OpenGL 0.0.2 does not exists. OpenGL 2.1 is needed at least, but I schould cover this, thanks. ;)
Did you tried Style.OpenGL | Style.Shown
?
from dgame.
The last argument to GLSettings is also part of the version? In the tutorial it says that it's for anti-aliasing http://dgame-dev.de/?page=tutorial&tut=gl_settings If that is not for anti-aliasing how do you add it in?
Also, yes Style.OpenGL works fine, I was using Style.Default when I had the rendering error. Putting in Style.OpenGL | Style.Shown in works as well, but passing in Style.HighDPI or Style.Shown by themselves crashes the process.
from dgame.
I'm sorry you're right. I was in a hurry and I've overlooked it, I thought for a momemt you put the patch level to OpenGL, not the Anti-Alias Level. :)
Also, yes Style.OpenGL works fine, I was using Style.Default when I had the rendering error. Putting in Style.OpenGL | Style.Shown in works as well, but passing in Style.HighDPI or Style.Shown by themselves crashes the process.
Yes because Style.OpenGL
is always needed. Only in special cases if you exactly know what you are doing you can ignore it. Otherwise you must combine them with a bit or (Style.Shown | Style.OpenGL
). I'll add a note for that in the coming version 0.6. :)
Besides that it I've got the feeling, that you discoverd the SDL bug which I mentioned before. I'll try to find a solution, but because I have no Mac I would like to notify you then, so that you can test that. Would that be ok?
from dgame.
Sure, you can notify me.
Is the anti-aliasing bug a part of the same issue?
from dgame.
No I'm sure it has something to do with the absence of Style.Shown
. I will investigate that.
from dgame.
I am passing in Style.Shown like so:
Window wnd = Window(640, 480, "Dgame Test", Window.Style.OpenGL | Window.Style.Shown, GLSettings(0, 0, 2));
from dgame.
And that makes the application crash?
from dgame.
Yeah. Also, the terminal output is the same as the error output above.
from dgame.
And without GLSettings(0, 0, 2)
it works?
from dgame.
Yup.
from dgame.
Seems to be an OSX issue. What is your Mac version?
from dgame.
10.10.3
from dgame.
Thanks a lot, I'll examine it tonight. Sorry for your trouble.
from dgame.
It's cool man, you're working for free :)
from dgame.
BTW: Do you have some other OS where you can test if it works? Then we could narrow it down to OSX.
from dgame.
I can boot up a linux VM. I will get back to you when I have D and SDL installed in it.
from dgame.
Ok, after trying to install OpenGL 3 on linux unsuccessfully for three hours, I am giving up. I am going to try to test this on windows instead.
from dgame.
Don't rush yourself. I am on Windows 8.1 Pro, 64 bit and it works like a charm.
from dgame.
I figured that I should create a separate issue for this, but I might as well mention it now. For some reason, the sprite in a player class does not render while sprites defined and drawn in the main loop render fine. Here is the code which demonstrates this: https://gist.github.com/JackStouffer/77f0843449a211e76614
I have tried many different images to make sure that there wasn't something wrong with the png, but each image just renders a blank white square.
from dgame.
That's not a bug, it's your fault, but maybe I should mention it somehow in the docs. ;)
You must hold the Texture because the Sprite does not own it, it stores only a pointer to it.
Dgame tries to avoid classes and Heap Allocations as much as possible, therefore many parts of Dgame (as Textures) are structs.
from dgame.
Ah, ok. I was able to fix it from your comment, thanks.
from dgame.
@JackStouffer Did you tried Windows or Linux and can say me that it works?
from dgame.
Oh sorry, I thought your comment implied that me testing it on Windows would be redundant because you have already tested it. I will test it on my windows machine by the end of the day.
from dgame.
Each machine is different. :) Would be nice to know if it works on linux,, but since no other issues were reported I'm sure it works.
from dgame.
Ok, I tried linux agian, this time on a different machine, but now I am getting this error:
$ dub
Target derelict-util 2.0.0 is up to date. Use --force to rebuild.
Target derelict-sdl2 1.9.5 is up to date. Use --force to rebuild.
Target derelict-gl3 1.0.13 is up to date. Use --force to rebuild.
Target dgame 0.5.3 is up to date. Use --force to rebuild.
Target dungeon ~master is up to date. Use --force to rebuild.
Running ./dungeon
SDL version: 2.0.2
core.exception.AssertError@../.dub/packages/dgame-0.5.3/source/Dgame/Internal/Error.d(12): Error: Failed to init the required jpg and png support: PNG images are not supported
----------------
./dungeon(nothrow @nogc void Dgame.Internal.Error.assert_fmt!(const(char)*).assert_fmt(bool, immutable(char)[], const(char)*)+0x7b) [0x4e619b]
./dungeon(void Dgame.Window.Internal.Init._initSDL()+0x15b) [0x4edaf7]
./dungeon(ref Dgame.Window.Window.Window Dgame.Window.Window.Window.__ctor!().__ctor(const(Dgame.Math.Rect.Rect), immutable(char)[], uint, Dgame.Window.GLSettings.GLSettings)+0x3a) [0x4e9c36]
./dungeon(ref Dgame.Window.Window.Window Dgame.Window.Window.Window.__ctor(uint, uint, immutable(char)[], uint, Dgame.Window.GLSettings.GLSettings)+0x7c) [0x4e89f8]
./dungeon(_Dmain+0x7b) [0x4e10a3]
./dungeon(_D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv+0x1f) [0x5109bf]
./dungeon(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x510912]
./dungeon(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll()+0x30) [0x510978]
./dungeon(void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())+0x2a) [0x510912]
./dungeon(_d_run_main+0x1dc) [0x51088c]
./dungeon(main+0x25) [0x4e1935]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fa105536ec5]
Error executing command run:
Program exited with code 1
I have all of the latest sdl libraries installed as well as libpng.
from dgame.
AFAIK the default SDL version on linux has no PNG support (which is required for Dgame) and you have to build the SDL by yourself. But you can test it in C++ if you want: https://www.libsdl.org/projects/SDL_image/docs/SDL_image_frame.html
from dgame.
I can now confirm that anti-aliasing works on linux. Specifically, this was tested with mesa OpenGL 3.0 on Ubuntu 14.04 LTS.
from dgame.
With Dgame 0.5 or 0.6 or both?
from dgame.
0.5
from dgame.
Thank you very much. If you find the time, it would be very helpful if you would test also Dgame 0.6 beta.
from dgame.
Is it possible to download the 0.6 beta with dub?
from dgame.
Yes:
"dgame": "~>0.6.0-beta.1"
from dgame.
Unfortunately that causes dub to throw an error:
$ dub upgrade
Upgrading project in /Users/Jack/Dropbox/code/dlang/dungeon_game
Error executing command upgrade:
Root package dungeon contains reference to invalid package dgame
Here is the dub.json
{
"name": "dungeon",
"sourcePaths":["."],
"dependencies": {
"dgame": "~>0.6.0-beta.1"
},
"targetType":"executable"
}
from dgame.
That's odd, maybe you schould clear all Dgame specific dub stuff first.
from dgame.
I deleted the stored Dgame library in ~/.dub/ and deleted dub.selections.json file, but I am still getting the same error.
from dgame.
Seems to be a dub issue since it works for me. Maybe you use an outdated version? I use 0.9.23
from dgame.
I have the latest version as well
$ dub --version
DUB version 0.9.23, built on Apr 6 2015
If I place "dgame": ">=0.5.0" back in everything works fine.
I am going to test this on linux and see what happens.
from dgame.
dub upgrade on linux works. I am going to create an issue on the dub project for this.
from dgame.
Thanks a lot. And the anti-alias/High-DPI works with the 0.6? You have to enable HighDPI now by yourself.
from dgame.
Well, I couldn't get the linux VM I have on my Mac with the high DPI screen to work, so the linux machine I have been testing on is on a normal 1080p screen. And I can't get dub to download the newest beta on my Mac, so I can't test it.
from dgame.
Alright, then thank you very much for your effort. I will close this as this is a known bug for Mac OS.
from dgame.
I wouldn't close this as we don't know for sure if the anti-aliasing is working for Mac yet.
from dgame.
But Anti-Alias is not the main concern here, that was High-DPI. If Anti-Alias is not working we will see a new issue
from dgame.
Related Issues (20)
- Iterating over SpriteSheet starts at index 1 and ends at index 0 HOT 13
- small issue on page HOT 2
- [Feature Request] A Window.draw overload with an offset HOT 4
- Dgame Does not render on multiple windows HOT 3
- Make Rect a template to allow for floating point HOT 1
- Necessary code doesn't execute when compiling in release mode HOT 3
- Shape color is being changed by unrelated objects HOT 5
- TTF_Init is not being called, formatting Text always errors "Font Invalid" HOT 5
- StopWatch Divide by 0 when trying to fill frame_ms HOT 1
- DerelictGL3 not able to find symbol ( glGetnTexImage ) HOT 3
- Window.wait Timeout is milliseconds, not seconds. HOT 1
- Collision detection HOT 4
- Wrong links in README.md? HOT 1
- Dgame crashing HOT 6
- Is this project still alive ? Couple bugs I ran into. HOT 8
- What about adding more built in colors? Like 400 plus . Color Enhancement idea . HOT 8
- Rect methods questions ? Add new method clamp ? HOT 1
- `object.Error@(0): Access Violation` on `DMD32` HOT 7
- D program quits unexpectedly when using Text HOT 11
- Text colors are wrong HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dgame.