Re: Compile time initialization of AA

2018-03-24 Thread Xavier Bigand via Digitalmars-d-learn
Le 23/03/2018 à 23:43, Xavier Bigand a écrit : I am trying to initialize an global immutable associative array of structs, but it doesn't compile. I am getting the following error message : "Error: not an associative array initializer". As I really need to store my data for

Compile time initialization of AA

2018-03-23 Thread Xavier Bigand via Digitalmars-d-learn
I am trying to initialize an global immutable associative array of structs, but it doesn't compile. I am getting the following error message : "Error: not an associative array initializer". As I really need to store my data for a compile time purpose if we can't do that with AA, I'll use array

Re: CTFE and -betterC

2018-03-16 Thread Xavier Bigand via Digitalmars-d-learn
Le 16/03/2018 à 22:58, Xavier Bigand a écrit : Le 15/03/2018 à 01:09, Flamaros a écrit : On Wednesday, 14 March 2018 at 01:17:54 UTC, rikki cattermole wrote: You will still need DllMain, that is a platform requirement. I am not sure about that because when DllAnalyser don't see it i

Re: CTFE and -betterC

2018-03-16 Thread Xavier Bigand via Digitalmars-d-learn
Le 15/03/2018 à 01:09, Flamaros a écrit : On Wednesday, 14 March 2018 at 01:17:54 UTC, rikki cattermole wrote: You will still need DllMain, that is a platform requirement. I am not sure about that because when DllAnalyser don't see it in the opengl32.dll from the system32 directory. And the d

CTFE and -betterC

2018-03-13 Thread Xavier Bigand via Digitalmars-d-learn
As I am trying to do a dll that acts exactly like one written in C, I am trying to compile my code with the -betterC option. So I would not need the DllMain function. I am not sure that I use the best syntax for my CTFE function to be able to make it works with the option -betterC and to maint

Re: How give a module to a CTFE function

2018-03-12 Thread Xavier Bigand via Digitalmars-d-learn
Le 12/03/2018 à 23:28, Xavier Bigand a écrit : Le 12/03/2018 à 23:24, Xavier Bigand a écrit : Le 12/03/2018 à 22:30, arturg a écrit : On Monday, 12 March 2018 at 21:00:07 UTC, Xavier Bigand wrote: Hi, I have a CTFE function that I want to make more generic by given it a module as parameter

Re: How give a module to a CTFE function

2018-03-12 Thread Xavier Bigand via Digitalmars-d-learn
Le 12/03/2018 à 23:24, Xavier Bigand a écrit : Le 12/03/2018 à 22:30, arturg a écrit : On Monday, 12 March 2018 at 21:00:07 UTC, Xavier Bigand wrote: Hi, I have a CTFE function that I want to make more generic by given it a module as parameter. My actual code looks like : mixin

Re: How give a module to a CTFE function

2018-03-12 Thread Xavier Bigand via Digitalmars-d-learn
Le 12/03/2018 à 22:30, arturg a écrit : On Monday, 12 March 2018 at 21:00:07 UTC, Xavier Bigand wrote: Hi, I have a CTFE function that I want to make more generic by given it a module as parameter. My actual code looks like : mixin(implementFunctionsOf()); string implementFunctionsOf

How give a module to a CTFE function

2018-03-12 Thread Xavier Bigand via Digitalmars-d-learn
Hi, I have a CTFE function that I want to make more generic by given it a module as parameter. My actual code looks like : mixin(implementFunctionsOf()); string implementFunctionsOf() { import std.traits; string res; foreach(name; __traits(allMembers, myHardCodedModule))

Re: Need help to compile code with traits

2017-02-05 Thread Xavier Bigand via Digitalmars-d-learn
Le 05/02/2017 à 18:32, Basile B. a écrit : On Sunday, 5 February 2017 at 14:59:04 UTC, Xavier Bigand wrote: Hi, I am trying to create an allocator that don't use the GC, and I have issues for the initialization of member before calling the constructor. Here is my actual code : mixin tem

Need help to compile code with traits

2017-02-05 Thread Xavier Bigand via Digitalmars-d-learn
Hi, I am trying to create an allocator that don't use the GC, and I have issues for the initialization of member before calling the constructor. Here is my actual code : mixin template NogcAllocator(T) { static TnogcNew(T, Args...)(Args args) @nogc { imp

Re: @nogc and opengl errors check

2017-01-21 Thread Xavier Bigand via Digitalmars-d-learn
Le 21/01/2017 à 13:24, Jerry a écrit : On Friday, 20 January 2017 at 22:47:17 UTC, Xavier Bigand wrote: Hi, I am writing some code with opengl commands that I want to check in debug, so I am using the function checkgl (from glamour lib). The issue is that checkgl throw exception and can'

@nogc and opengl errors check

2017-01-20 Thread Xavier Bigand via Digitalmars-d-learn
Hi, I am writing some code with opengl commands that I want to check in debug, so I am using the function checkgl (from glamour lib). The issue is that checkgl throw exception and can't be @nogc, I had try to use std.experimental.logger in place of exceptions, but it doesn't work either. I

Re: Dynamic arrays with static initialization and maybe a bug with sizeof

2016-12-13 Thread Xavier Bigand via Digitalmars-d-learn
Le 13/12/2016 23:44, Johan Engelen a écrit : On Tuesday, 13 December 2016 at 21:27:57 UTC, Xavier Bigand wrote: Hi, I have the following code snippet : voidset() { GLfloat[]data = [ -1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, 1.0f

Using Nsight with VisualD

2016-12-13 Thread Xavier Bigand via Digitalmars-d-learn
Hi, I am trying to use Nsight with VisualD by it tell me that it can not start the program "". It seems that it does not use the right property of the project to retrieve the path of my generated binary. I do not know if it is an issue of VisualD directly or DUB that don't correctly generate

Re: Dynamic arrays with static initialization and maybe a bug with sizeof

2016-12-13 Thread Xavier Bigand via Digitalmars-d-learn
Le 13/12/2016 22:39, ag0aep6g a écrit : On 12/13/2016 10:27 PM, Xavier Bigand wrote: voidset() { GLfloat[]data = [ -1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, ]; glBindVertexArray(mVAO

Dynamic arrays with static initialization and maybe a bug with sizeof

2016-12-13 Thread Xavier Bigand via Digitalmars-d-learn
Hi, I have the following code snippet : voidset() { GLfloat[] data = [ -1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, ]; glBindVertexArray(

Question about DUB

2016-12-11 Thread Xavier Bigand via Digitalmars-d-learn
Hi, I am using DUB with the SDL language and I have two questions: 1. How can I add some text file to my project? I want to add shaders in my Visual Project. 2. How to make a compiler option depending on the platform and debug mode at the same time? Thanks.

Re: Memory usage of dmd

2014-11-12 Thread Xavier Bigand via Digitalmars-d-learn
Le 10/11/2014 20:52, "Marc Schütz" " a écrit : If your server runs systemd, I would strongly recommend to use that instead of a shell script. You can use "Restart=always" or "Restart=on-failure" in the unit file. It also provides socket activation, which will allow you to restart the program with

Re: Memory usage of dmd

2014-11-10 Thread Xavier Bigand via Digitalmars-d-learn
Le 10/11/2014 18:17, Etienne a écrit : On 2014-11-10 12:02 PM, Xavier Bigand wrote: As I know to be able to have no down time with vibe we need to be able to build directly on the server where the program runs. Maybe I just need to wait that I have some users to pay a better server with more

Re: Memory usage of dmd

2014-11-10 Thread Xavier Bigand via Digitalmars-d-learn
Le 10/11/2014 17:41, Etienne a écrit : On 2014-11-10 11:32 AM, Xavier Bigand wrote: Is there some options can help me to reduce the memory consumption? As it's for production purpose I don't think that is a good idea to remove compiler optimizations. The memory issues are probably

Memory usage of dmd

2014-11-10 Thread Xavier Bigand via Digitalmars-d-learn
I develop a web site with vibe, but because I am using a Virtual Private Server I get some memory issues. The server only has 1Go of memory (> 900Mo free) and it seems I can't compile directly on it a simple static page (70 lines). I get the following message when building with dub : Running d

Is it normal that unittests of phobos are executed with my project build?

2014-06-14 Thread Xavier Bigand via Digitalmars-d-learn
I get a failure on a test in format.d when I build my own project with unittest. I though importing phobos header would not regenerate their unittest modules. Any idea of what can cause this issue? I already have reinstalled dmd with visualD completely.

Re: Working on a library: request for code review

2014-06-12 Thread Xavier Bigand via Digitalmars-d-learn
Le 12/06/2014 20:35, Xavier Bigand a écrit : Le 12/06/2014 20:09, Rene Zwanenburg a écrit : On Thursday, 12 June 2014 at 15:46:12 UTC, Mike wrote: On Thursday, 12 June 2014 at 00:20:28 UTC, cal wrote: Might it be worth stitching things together into a proper image processing package? Well I

Re: Working on a library: request for code review

2014-06-12 Thread Xavier Bigand via Digitalmars-d-learn
Le 12/06/2014 20:09, Rene Zwanenburg a écrit : On Thursday, 12 June 2014 at 15:46:12 UTC, Mike wrote: On Thursday, 12 June 2014 at 00:20:28 UTC, cal wrote: Might it be worth stitching things together into a proper image processing package? Well I started working on TGA because I was disappoin

Re: fix struct API with an interface

2014-03-06 Thread Xavier Bigand
Le 06/03/2014 19:08, Dicebot a écrit : On Thursday, 6 March 2014 at 14:28:13 UTC, Flamaros wrote: Ok, it's like I though final class and struct are equivalent when calling a method (except the pointer deference, but it's minor I think). I don't think there is a real performance problem for us,

adding static return?

2014-03-03 Thread Xavier Bigand
I thought it could be nice to have a static return. My Idea is to remove unnecessary bracket encapsulation made with some static if statements. It will works like this : module xxx.opengl; import buildSettings; // contains some global constants static if (renderMode == directX) return; .

Re: GC for noobs

2014-02-28 Thread Xavier Bigand
Le 28/02/2014 13:22, Szymon Gatner a écrit : On Friday, 28 February 2014 at 11:43:58 UTC, Dicebot wrote: On Friday, 28 February 2014 at 11:28:01 UTC, Szymon Gatner wrote: I didn't mean "basic" in the sense of "easy" but in the sense of something that has to dealt with all the time / is common r

Re: [Windows & DMD] No callstack when crash with Access violation reading location 0x00000000

2014-01-29 Thread Xavier Bigand
Le 22/01/2014 14:13, Flamaros a écrit : On Wednesday, 22 January 2014 at 02:11:02 UTC, TheFlyingFiddle wrote: On Saturday, 18 January 2014 at 19:40:38 UTC, Xavier Bigand wrote: I am not sure the issue come really from my code, cause it just works fine on ATI cards, I do something Nvidia

Re: [Windows & DMD] No callstack when crash with Access violation reading location 0x00000000

2014-01-19 Thread Xavier Bigand
Le 13/01/2014 22:47, Benjamin Thaut a écrit : Am 13.01.2014 21:52, schrieb Xavier Bigand: glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,9) glBindBuffer(GL_ARRAY_BUFFER,10) glEnableVertexAttribArray(0) glVertexAttribPointer(0,3,GL_FLOAT,false,12,) glBindBuffer(GL_ARRAY_BUFFER,11

Re: [Windows & DMD] No callstack when crash with Access violation reading location 0x00000000

2014-01-13 Thread Xavier Bigand
Le 13/01/2014 20:42, Xavier Bigand a écrit : Le 12/01/2014 18:01, Benjamin Thaut a écrit : Am 12.01.2014 17:18, schrieb Xavier Bigand: Le 12/01/2014 11:16, Benjamin Thaut a écrit : Am 12.01.2014 00:47, schrieb Xavier Bigand: I didn't know this menu settings, but activate Access Viol

Re: [Windows & DMD] No callstack when crash with Access violation reading location 0x00000000

2014-01-13 Thread Xavier Bigand
Le 12/01/2014 18:01, Benjamin Thaut a écrit : Am 12.01.2014 17:18, schrieb Xavier Bigand: Le 12/01/2014 11:16, Benjamin Thaut a écrit : Am 12.01.2014 00:47, schrieb Xavier Bigand: I didn't know this menu settings, but activate Access Violation don't change anything. It seems

Re: [Windows & DMD] No callstack when crash with Access violation reading location 0x00000000

2014-01-12 Thread Xavier Bigand
Le 12/01/2014 11:16, Benjamin Thaut a écrit : Am 12.01.2014 00:47, schrieb Xavier Bigand: I didn't know this menu settings, but activate Access Violation don't change anything. It seems that your crash happens inside the OpenGL part of the graphics driver. It is caused by DQuick\

Re: [Windows & DMD] No callstack when crash with Access violation reading location 0x00000000

2014-01-11 Thread Xavier Bigand
Le 12/01/2014 00:30, Benjamin Thaut a écrit : Am 11.01.2014 22:56, schrieb Xavier Bigand: Le 11/01/2014 22:15, Benjamin Thaut a écrit : Am 11.01.2014 20:50, schrieb Xavier Bigand: Yes I have no stack trace and adding import core.sys.windows.stacktrace change nothing. That is very strange

Re: [Windows & DMD] No callstack when crash with Access violation reading location 0x00000000

2014-01-11 Thread Xavier Bigand
Le 11/01/2014 22:15, Benjamin Thaut a écrit : Am 11.01.2014 20:50, schrieb Xavier Bigand: Yes I have no stack trace and adding import core.sys.windows.stacktrace change nothing. That is very strange. Can you reduce this? Or is this project on github somewhere? Did you try using a debugger

Re: [Windows & DMD] No callstack when crash with Access violation reading location 0x00000000

2014-01-11 Thread Xavier Bigand
Le 11/01/2014 19:40, Benjamin Thaut a écrit : Am 11.01.2014 19:16, schrieb Xavier Bigand: Le 11/01/2014 18:45, Benjamin Thaut a écrit : Am 11.01.2014 17:24, schrieb Xavier Bigand: I get some troubles to solve a memory bug, just cause I don't have any informations for debuggers and I

Re: [Windows & DMD] No callstack when crash with Access violation reading location 0x00000000

2014-01-11 Thread Xavier Bigand
Le 11/01/2014 17:24, Xavier Bigand a écrit : I get some troubles to solve a memory bug, just cause I don't have any informations for debuggers and I can't neither use DrMemory. Is it possible to get the callstack when calling a method on a null pointer with specifics DMD flags? Mayb

Re: [Windows & DMD] No callstack when crash with Access violation reading location 0x00000000

2014-01-11 Thread Xavier Bigand
Le 11/01/2014 18:45, Benjamin Thaut a écrit : Am 11.01.2014 17:24, schrieb Xavier Bigand: I get some troubles to solve a memory bug, just cause I don't have any informations for debuggers and I can't neither use DrMemory. Is it possible to get the callstack when calling a method

Re: [Windows & DMD] No callstack when crash with Access violation reading location 0x00000000

2014-01-11 Thread Xavier Bigand
Le 11/01/2014 18:20, Namespace a écrit : On Saturday, 11 January 2014 at 16:24:08 UTC, Xavier Bigand wrote: I get some troubles to solve a memory bug, just cause I don't have any informations for debuggers and I can't neither use DrMemory. Is it possible to get the callstack when

[Windows & DMD] No callstack when crash with Access violation reading location 0x00000000

2014-01-11 Thread Xavier Bigand
I get some troubles to solve a memory bug, just cause I don't have any informations for debuggers and I can't neither use DrMemory. Is it possible to get the callstack when calling a method on a null pointer with specifics DMD flags? Maybe DMD need add null ptr call checks in debug mode?

Re: Getting backtrace

2014-01-09 Thread Xavier Bigand
Le 08/01/2014 21:29, Benjamin Thaut a écrit : Am 08.01.2014 21:25, schrieb Xavier Bigand: Is there a way to get backtrace outside exceptions? Found a plattform independend way: import core.runtime; import std.stdio; void main(string[] args) { auto trace = defaultTraceHandler(null

Getting backtrace

2014-01-08 Thread Xavier Bigand
Is there a way to get backtrace outside exceptions?

Re: [Windows] Building in 64bits

2013-12-20 Thread Xavier Bigand
Le 20/12/2013 02:54, Rikki Cattermole a écrit : On Thursday, 19 December 2013 at 20:37:32 UTC, Xavier Bigand wrote: I try to build in 64bits with dmd to be able to use VS tools. Please notice on linux our project build fine in 64bits. Here is my error : E:\Dev\Personal\DQuick\src\samples

[Windows] Building in 64bits

2013-12-19 Thread Xavier Bigand
I try to build in 64bits with dmd to be able to use VS tools. Please notice on linux our project build fine in 64bits. Here is my error : E:\Dev\Personal\DQuick\src\samples\Minesweeper>dub --arch=x86_64 Checking dependencies in 'E:\Dev\Personal\DQuick\src\samples\Minesweeper' Building configura

Re: How to link to libdl under linux

2013-12-19 Thread Xavier Bigand
Le 19/12/2013 13:46, MrSmith a écrit : Still need help. I've tried compiling a little test project with dub and it compiled. Then i tried to compile it by hand and got the same error. I think there is some issue in my command with parameter ordering. Here is test project module test; import de

Re: Deimos rules?

2013-12-01 Thread Xavier Bigand
Le 13/11/2013 23:01, Xavier Bigand a écrit : I work on XCB integration, so I think that I can add bindings in deimos. C headers are translated to d modules by using DStep or manually? If manually need I respect some syntactical rules? I think it's enough mature to be integrated to deimo

Re: longjmp crashes on Windows

2013-11-16 Thread Xavier Bigand
Le 16/11/2013 23:26, Rene Zwanenburg a écrit : On Saturday, 16 November 2013 at 16:22:17 UTC, Piotr Podsiadły wrote: On Saturday, 16 November 2013 at 14:41:46 UTC, Maxim Fomin wrote: What kind of problem you try to solve by manual defining system data structures? Why not use platform independen

Re: Deimos rules?

2013-11-14 Thread Xavier Bigand
Le 14/11/2013 13:13, Jacob Carlborg a écrit : On 2013-11-13 23:01, Xavier Bigand wrote: I work on XCB integration, so I think that I can add bindings in deimos. C headers are translated to d modules by using DStep or manually? If manually need I respect some syntactical rules? I would say

Deimos rules?

2013-11-13 Thread Xavier Bigand
I work on XCB integration, so I think that I can add bindings in deimos. C headers are translated to d modules by using DStep or manually? If manually need I respect some syntactical rules?

Re: [Font] Getting font folder on all platforms

2013-11-12 Thread Xavier Bigand
Le 08/11/2013 21:05, Flamaros a écrit : On Tuesday, 15 October 2013 at 23:10:32 UTC, Flamaros wrote: On Friday, 6 September 2013 at 20:54:53 UTC, Flamaros wrote: On Friday, 6 September 2013 at 16:05:43 UTC, Tourist wrote: On Thursday, 5 September 2013 at 19:48:07 UTC, Flamaros wrote: I am sea